このページを編集する際は、[[編集に関する方針]]に従ってください。 *概要 [#jd3d18dd] -対象:8.1.4 -言語:C -宣言・定義:[[postgresql-8.1.4/src/include/mb/pg_wchar.h]] -宣言・定義:[[postgresql-8.1.4/src/include/utils/palloc.h]] **[[postgresql-8.1.4/src/include/mb/pg_wchar.h]] [#m0b5c79e] -mallocの別名。 **[[postgresql-8.1.4/src/include/utils/palloc.h]] [#y5626d88] - グローバル変数 [[CurrentMemoryContext/postgresql-8.1.4]] 配下の関数ポインタ CurrentMemoryContext->methods->alloc で指定されている関数をコールして、戻り値を返す。 - %%グローバル変数 [[CurrentMemoryContext/postgresql-8.1.4]] 配下の関数ポインタ CurrentMemoryContext->methods->alloc で指定されている関数をコールして、戻り値を返す。%% --引数 sz が[[MaxAllocSize/postgresql-8.1.4]]より大きければ、[[elog()/postgresql-8.1.4]]を再帰呼び出しする。 --(USE_ASSERT_CHECKINGを指定したバイナリの場合)assert_enabledが0以外、かつ、 ポインタCurrentMemoryContextを構造体[[Node/postgresql-8.1.4]]型のポインタにキャストしたときにtypeメンバに相当する値がT_AllocSetContextでない時、エラー情報を出力してプログラムを停止する。 *引数 [#r2e08830] **[[postgresql-8.1.4/src/include/mb/pg_wchar.h]] [#zd3697d8] -(mallocと同様) **[[postgresql-8.1.4/src/include/utils/palloc.h]] [#bbfd2162] -sz -- 内部にて CurrentMemoryContext->methods->alloc で指定されている関数をコールする際に与える引数。 *実装 [#o2b2bbb1] **[[postgresql-8.1.4/src/include/mb/pg_wchar.h]] [#n09dc534] #ifdef FRONTEND #undef palloc #define palloc malloc #endif **[[postgresql-8.1.4/src/include/utils/palloc.h]] [#affa66f6] #define palloc(sz) MemoryContextAlloc(CurrentMemoryContext, (sz)) -[[MemoryContextAlloc()/postgresql-8.1.4]] -- 引数 CurrentMemoryContext 配下の関数ポインタ context->methods->alloc で指定されている関数をコールして、戻り値を返す。 -[[MemoryContextAlloc()/postgresql-8.1.4]] -- %%引数 CurrentMemoryContext 配下の関数ポインタ context->methods->alloc で指定されている関数をコールして、戻り値を返す。%% --引数 sz が[[MaxAllocSize/postgresql-8.1.4]]より大きければ、[[elog()/postgresql-8.1.4]]を再帰呼び出しする。 --(USE_ASSERT_CHECKINGを指定したバイナリの場合)assert_enabledが0以外、かつ、 ポインタCurrentMemoryContextを構造体[[Node/postgresql-8.1.4]]型のポインタにキャストしたときにtypeメンバに相当する値がT_AllocSetContextでない時、エラー情報を出力してプログラムを停止する。 -[[CurrentMemoryContext/postgresql-8.1.4]] -- 下記メンバを持つ構造体MemoryContextDataへのポインタ型のグローバル変数。 --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 *呼出元 [#d446ecf4] -[[initStringInfo()/postgresql-8.1.4]] *備考 [#ebf50cb6] -解読を一旦中止([[関数ポインタ①/解読日記]]を参照) *履歴 [#qe87421d] -作者:[[testnoda/ページ作者]] -日付:2007/4/24 |更新日|更新者|更新内容| |2007/4/24|[[testnoda/ページ作者]]|解読を一旦中止([[関数ポインタ①/解読日記]]を参照)| |||| *コメント [#zd241427] #comment