このページを編集する際は、[[編集に関する方針]]に従ってください。 *概要 [#j11c540e] -対象:8.1.4 -言語:C -宣言・定義:[[postgresql-8.1.4/src/include/nodes/memnodes.h]] -下記のメンバを持つ構造体。 -下記メンバを持つ構造体。 --void*型の関数ポインタalloc --void型の関数ポインタfree_p --void*型の関数ポインタrealloc --void型の関数ポインタinit --void型の関数ポインタreset --void型の関数ポインタdelete --Size型の関数ポインタget_chunk_space --bool型の関数ポインタis_empty --void型の関数ポインタstats --void型の関数ポインタcheck *実装 [#n23d9268] typedef struct MemoryContextMethods { void *(*alloc) (MemoryContext context, Size size); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) -[[Size/postgresql-8.1.4]] -- size_tの別名 /* call this free_p in case someone #define's free() */ void (*free_p) (MemoryContext context, void *pointer); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) void *(*realloc) (MemoryContext context, void *pointer, Size size); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) -[[Size/postgresql-8.1.4]] -- size_tの別名 void (*init) (MemoryContext context); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) void (*reset) (MemoryContext context); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) void (*delete) (MemoryContext context); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) Size (*get_chunk_space) (MemoryContext context, void *pointer); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) bool (*is_empty) (MemoryContext context); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) void (*stats) (MemoryContext context); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) #ifdef MEMORY_CONTEXT_CHECKING void (*check) (MemoryContext context); -[[MemoryContext/postgresql-8.1.4]] -- MemoryContextDataへのポインタ(再帰的使用) #endif } MemoryContextMethods; *呼出元 [#jdf873a8] -[[MemoryContextData/postgresql-8.1.4]] *備考 [#l5c35f05] -(*alloc)、(*free_p)、…などは、関数ポインタである。 -[[再帰呼び出し①/解読日記]]参照 * MemoryContext * A logical context in which memory allocations occur. * * MemoryContext itself is an abstract type that can have multiple * implementations, though for now we have only AllocSetContext. * The function pointers in MemoryContextMethods define one specific * implementation of MemoryContext --- they are a virtual function table * in C++ terms. * * Node types that are actual implementations of memory contexts must * begin with the same fields as MemoryContext. * * Note: for largely historical reasons, typedef MemoryContext is a pointer * to the context struct rather than the struct type itself. *履歴 [#u3273ebd] -作者:[[testnoda/ページ作者]] -日付:2007/2/25 |更新日|更新者|更新内容| |||| *コメント [#c13a33ff] #comment