このページを編集する際は、編集に関する方針に従ってください。
概要 †
- 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
MemoryContextReset(MemoryContext context)
{
AssertArg(MemoryContextIsValid(context));
/* save a function call in common case where there are no children */
if (context->firstchild != NULL)
MemoryContextResetChildren(context);
(*context->methods->reset) (context);
- 引数context配下の関数ポインタmethods->resetで示される関数を、引数contextについて実行。
}
呼出元 †
備考 †
/*
* MemoryContextReset
* Release all space allocated within a context and its descendants,
* but don't delete the contexts themselves.
*
* The type-specific reset routine handles the context itself, but we
* have to do the recursion for the children.
*/
履歴 †
コメント †