Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94e90d9

Browse files
committed
Add some more Assert checks.
1 parent7893462 commit94e90d9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/backend/utils/mmgr/mcxt.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
*
1616
* IDENTIFICATION
17-
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.23 2000/07/11 14:30:28 momjian Exp $
17+
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.24 2000/08/22 04:00:10 tgl Exp $
1818
*
1919
*-------------------------------------------------------------------------
2020
*/
@@ -114,6 +114,8 @@ MemoryContextInit(void)
114114
void
115115
MemoryContextReset(MemoryContextcontext)
116116
{
117+
AssertArg(MemoryContextIsValid(context));
118+
117119
MemoryContextResetChildren(context);
118120
(*context->methods->reset) (context);
119121
}
@@ -129,6 +131,8 @@ MemoryContextResetChildren(MemoryContext context)
129131
{
130132
MemoryContextchild;
131133

134+
AssertArg(MemoryContextIsValid(context));
135+
132136
for (child=context->firstchild;child!=NULL;child=child->nextchild)
133137
{
134138
MemoryContextReset(child);
@@ -148,6 +152,7 @@ MemoryContextResetChildren(MemoryContext context)
148152
void
149153
MemoryContextDelete(MemoryContextcontext)
150154
{
155+
AssertArg(MemoryContextIsValid(context));
151156
/* We had better not be deleting TopMemoryContext ... */
152157
Assert(context!=TopMemoryContext);
153158
/* And not CurrentMemoryContext, either */
@@ -194,6 +199,7 @@ MemoryContextDelete(MemoryContext context)
194199
void
195200
MemoryContextDeleteChildren(MemoryContextcontext)
196201
{
202+
AssertArg(MemoryContextIsValid(context));
197203
/*
198204
* MemoryContextDelete will delink the child from me,
199205
* so just iterate as long as there is a child.
@@ -215,6 +221,8 @@ MemoryContextDeleteChildren(MemoryContext context)
215221
void
216222
MemoryContextResetAndDeleteChildren(MemoryContextcontext)
217223
{
224+
AssertArg(MemoryContextIsValid(context));
225+
218226
MemoryContextDeleteChildren(context);
219227
(*context->methods->reset) (context);
220228
}
@@ -231,6 +239,8 @@ MemoryContextStats(MemoryContext context)
231239
{
232240
MemoryContextchild;
233241

242+
AssertArg(MemoryContextIsValid(context));
243+
234244
(*context->methods->stats) (context);
235245
for (child=context->firstchild;child!=NULL;child=child->nextchild)
236246
{
@@ -251,6 +261,8 @@ MemoryContextCheck(MemoryContext context)
251261
{
252262
MemoryContextchild;
253263

264+
AssertArg(MemoryContextIsValid(context));
265+
254266
(*context->methods->check) (context);
255267
for (child=context->firstchild;child!=NULL;child=child->nextchild)
256268
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp