このページを編集する際は、[[編集に関する方針]]に従ってください。 *概要 [#g04df4d7] -対象:8.1.4 -言語:C -宣言:[[postgresql-8.1.4/src/include/utils/memutils.h]](extern) -定義:[[postgresql-8.1.4/src/backend/utils/mmgr/mcxt.c]] - [[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でなければ、エラー情報を出力してプログラムを停止する。 *引数 [#y5b67cc3] 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 *実装 [#l1c2d270] 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である時、エラー情報を出力してプログラムを停止する。 -[[MemoryContextIsValid()/postgresql-8.1.4]] -- ポインタcontextを構造体[[Node/postgresql-8.1.4]]型のポインタにキャストしたときにtypeメンバに相当する値が、T_AllocSetContextであるかどうか判別する。 for (child = context->firstchild; child != NULL; child = child->nextchild) MemoryContextReset(child); -[[MemoryContextReset()/postgresql-8.1.4]] -- 呼び出し元(再帰的使用) } *呼出元 [#h7cfedd0] -[[MemoryContextReset()/postgresql-8.1.4]] *備考 [#c8d73abe] -[[再起呼び出し②/解読日記]] -[[再帰呼び出し②/解読日記]] * MemoryContextResetChildren * Release all space allocated within a context's descendants, * but don't delete the contexts themselves. The named context * itself is not touched. *履歴 [#l75d6b06] -作者:[[testnoda/ページ作者]] -日付:2007/3/11 |更新日|更新者|更新内容| |||| *コメント [#m21cf12c] #comment