このページを編集する際は、編集に関する方針に従ってください。
概要 †
- MemoryContextReset()/postgresql-8.1.4を再帰的に呼び出す。
- ポインタcontext->firstchildで示されるMemoryContextインスタンスから呼び出しを開始。
- 順番に->nextchildで示されるMemoryContextインスタンスについて呼び出しを実行。
- ->nextchild==NULLとなったら終了。
- ただし、USE_ASSERT_CHECKINGを指定したバイナリの場合、assert_enabledが0以外、かつ、ポインタcontextを構造体Node/postgresql-8.1.4型のポインタにキャストしたときにtypeメンバに相当する値が、T_AllocSetContextでなければ、エラー情報を出力してプログラムを停止する。
引数 †
MemoryContext context
- MemoryContext/postgresql-8.1.4 -- 下記メンバを持つ構造体。
- NodeTag列挙型の変数type
- 下記メンバを持つ構造体型MemoryContextMethodsへのポインタmethods
- void*型の関数ポインタalloc
- void型の関数ポインタfree_p
- void*型の関数ポインタrealloc
- void型の関数ポインタinit
- void型の関数ポインタreset
- void型の関数ポインタdelete
- Size型の関数ポインタget_chunk_space
- bool型の関数ポインタis_empty
- void型の関数ポインタstats
- void型の関数ポインタcheck
- MemoryContextDataへのポインタparent(再帰的使用)
- MemoryContextDataへのポインタfirstchild(再帰的使用)
- MemoryContextDataへのポインタnextchild(再帰的使用)
- char型へのポインタname
実装 †
void
MemoryContextResetChildren(MemoryContext context)
{
MemoryContext child;
- MemoryContext/postgresql-8.1.4 -- 下記メンバを持つ構造体。
- NodeTag列挙型の変数type
- 下記メンバを持つ構造体型MemoryContextMethodsへのポインタmethods
- void*型の関数ポインタalloc
- void型の関数ポインタfree_p
- void*型の関数ポインタrealloc
- void型の関数ポインタinit
- void型の関数ポインタreset
- void型の関数ポインタdelete
- Size型の関数ポインタget_chunk_space
- bool型の関数ポインタis_empty
- void型の関数ポインタstats
- void型の関数ポインタcheck
- MemoryContextDataへのポインタparent(再帰的使用)
- MemoryContextDataへのポインタfirstchild(再帰的使用)
- MemoryContextDataへのポインタnextchild(再帰的使用)
- char型へのポインタname
AssertArg(MemoryContextIsValid(context));
- AssertArg()/postgresql-8.1.4
- USE_ASSERT_CHECKINGを指定しないバイナリの場合、なにもしない(プリコンパイル時に引数conditionを削除する)
- USE_ASSERT_CHECKINGを指定したバイナリの場合、assert_enabledが0以外、かつ、評価式conditionの結果が0である時、エラー情報を出力してプログラムを停止する。
for (child = context->firstchild; child != NULL; child = child->nextchild)
MemoryContextReset(child);
}
呼出元 †
備考 †
* MemoryContextResetChildren
* Release all space allocated within a context's descendants,
* but don't delete the contexts themselves. The named context
* itself is not touched.
履歴 †
コメント †