aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-08-22 04:00:10 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-08-22 04:00:10 +0000
commit94e90d9a86a186c83891fe4ce3e343bcf1860053 (patch)
tree44c3293826cb137326fd40294c4f68372e27ed62 /src
parent7893462e44756a0ab110e43b4c5c41a5e96e6883 (diff)
downloadpostgresql-94e90d9a86a186c83891fe4ce3e343bcf1860053.tar.gz
postgresql-94e90d9a86a186c83891fe4ce3e343bcf1860053.zip
Add some more Assert checks.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/mmgr/mcxt.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 874f609671d..b8f994d098d 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.23 2000/07/11 14:30:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.24 2000/08/22 04:00:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -114,6 +114,8 @@ MemoryContextInit(void)
void
MemoryContextReset(MemoryContext context)
{
+ AssertArg(MemoryContextIsValid(context));
+
MemoryContextResetChildren(context);
(*context->methods->reset) (context);
}
@@ -129,6 +131,8 @@ MemoryContextResetChildren(MemoryContext context)
{
MemoryContext child;
+ AssertArg(MemoryContextIsValid(context));
+
for (child = context->firstchild; child != NULL; child = child->nextchild)
{
MemoryContextReset(child);
@@ -148,6 +152,7 @@ MemoryContextResetChildren(MemoryContext context)
void
MemoryContextDelete(MemoryContext context)
{
+ AssertArg(MemoryContextIsValid(context));
/* We had better not be deleting TopMemoryContext ... */
Assert(context != TopMemoryContext);
/* And not CurrentMemoryContext, either */
@@ -194,6 +199,7 @@ MemoryContextDelete(MemoryContext context)
void
MemoryContextDeleteChildren(MemoryContext context)
{
+ AssertArg(MemoryContextIsValid(context));
/*
* MemoryContextDelete will delink the child from me,
* so just iterate as long as there is a child.
@@ -215,6 +221,8 @@ MemoryContextDeleteChildren(MemoryContext context)
void
MemoryContextResetAndDeleteChildren(MemoryContext context)
{
+ AssertArg(MemoryContextIsValid(context));
+
MemoryContextDeleteChildren(context);
(*context->methods->reset) (context);
}
@@ -231,6 +239,8 @@ MemoryContextStats(MemoryContext context)
{
MemoryContext child;
+ AssertArg(MemoryContextIsValid(context));
+
(*context->methods->stats) (context);
for (child = context->firstchild; child != NULL; child = child->nextchild)
{
@@ -251,6 +261,8 @@ MemoryContextCheck(MemoryContext context)
{
MemoryContext child;
+ AssertArg(MemoryContextIsValid(context));
+
(*context->methods->check) (context);
for (child = context->firstchild; child != NULL; child = child->nextchild)
{