- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2017-05-17T21:18:55+09:00","default:haikikyou","haikikyou")
#author("2017-05-22T22:37:28+09:00","default:haikikyou","haikikyou")
[[PostgreSQL/開発]]
#contents
* 概要 [#d39eb51e]
- 概要説明
* 定義 [#x1a86688]
** マクロ [#qcffa5c6]
*** MaxAllocSize, MaxAllocHugeSize [#r5e25b72]
|~マクロ名|~説明|~値|h
|MaxAllocSize||0|
|MaxAllocHugeSize||(8 * 1024 * 1024)|
*** AllocSizeIsValid, AllocHugeSizeIsValid [#o711b550]
*** STANDARDCHUNKHEADERSIZE [#l8764aec]
*** MemoryContextResetAndDeleteChildren [#u74855f2]
*** ALLOCSET_DEFAULT_XXXX [#i7676be1]
|~定数|~説明|~値|h
|ALLOCSET_DEFAULT_MINSIZE||0|
|ALLOCSET_DEFAULT_INITSIZE||(8 * 1024)|
|ALLOCSET_DEFAULT_MAXSIZE||(8 * 1024 * 1024)|
*** ALLOCSET_SMALL_XXXX [#x8b6a559]
|~定数|~説明|~値|h
|ALLOCSET_SMALL_MINSIZE||0|
|ALLOCSET_SMALL_INITSIZE||(1 * 1024)|
|ALLOCSET_SMALL_MAXSIZE||(8 * 1024)|
*** ALLOCSET_SEPARATE_THRESHOLD [#v16bd8d2]
** 列挙型 [#a91733b0]
** 構造体 [#j3ab1cd0]
*** Struct [#pd8e61e3]
|~番号|~データ型|~フィールド|~説明|h
** 関数 [#i96c7150]
** 関数 [#u75fdaa2]
*** 関数名 [#b597e766]
*** MemoryContextInit [#zfc402dc]
#geshi(c){{
extern void MemoryContextInit(void);
}}
- メモリコンテスト管理システムの初期化を行なう。
- postmasterのスタートアップ時に呼ばれるので,拡張機能などでこの関数を呼ぶケースはない(すでにメモリコンテキスト管理が利用できる状態になっているため)。
- この処理の中で,TopMemoryContextというメモリコンテキストツリーのトープレベルのメモリコンテキストとErrorContextが作成される。
&size(12){&color(white,orange){ 参考 };}; [[MemoryContextInit()>https://doxygen.postgresql.org/mcxt_8c.html#a90e9ce77120b687f9197ec3f42556e7b]] - on doxygen.postgresql.org
*** MemoryContextReset [#r2f7ee24]
#geshi(c){{
// 引数1:対象のメモリコンテキスト
extern void MemoryContextReset(MemoryContext context);
}}
- 指定されたメモリコンテキスト及び子階層に割り当てられたメモリ領域を解放する。
- 子階層のメモリコンテキストに対しては,MemoryContextDelete()(AllocSetDelete())を再帰的に呼ぶ。
- 対象のメモリコンテキスト(context)については,MemoryContextResetOnly()(AllocSetReset())が呼ばれる。contextの最初のブロック(存在すれば)は残され,メモリチャンクは消去される(freeptrは先頭にポイントされる)。
&size(12){&color(white,orange){ 参考 };};
- [[AllocSetDelete()>https://doxygen.postgresql.org/aset_8c.html#a800b4ddef4d9f1bc24252d34af22971c]] - on doxygen.postgresql.org
- [[AllocSetReset()>https://doxygen.postgresql.org/aset_8c.html#a4184c05efdf010f2c86bb057f4bc41a9]] - on doxygen.postgresql.org
*** MemoryContextDelete [#j584a692]
#geshi(c){{
// 引数1:対象のメモリコンテキスト
extern void MemoryContextDelete(MemoryContext context);
}}
- 指定されたメモリコンテキストのメモリ領域を解放する。
- 子階層のメモリコンテキストも再帰的に処理される。
&size(12){&color(white,orange){ 参考 };}; [[MemoryContextDelete()>https://doxygen.postgresql.org/mcxt_8c.html#adabf8bdc427b4e273e7445b4701f51f2]] - on doxygen.postgresql.org
*** MemoryContextResetOnly [#x6978405]
#geshi(c){{
// 引数1:対象のメモリコンテキスト
extern void MemoryContextResetOnly(MemoryContext context);
}}
- 指定されたメモリコンテキストをリセットする(AllocSetReset()が呼ばれる)。
- 子階層のメモリコンテキストに対しては何もしない。
*** MemoryContextResetChildren [#g76807a0]
#geshi(c){{
// 引数1:対象のメモリコンテキスト
extern void MemoryContextResetChildren(MemoryContext context);
}}
- 指定されたメモリコンテキストの子階層のメモリコンテキストに対して,再帰的にMemoryContextResetOnly関数を呼ぶ。
*** MemoryContextDeleteChildren [#q7ca2c17]
#geshi(c){{
// 引数1:対象のメモリコンテキスト
extern void MemoryContextDeleteChildren(MemoryContext context);
}}
- 指定されたメモリコンテキストの子階層のメモリコンテキストに対して,再帰的にMemoryContextDelete関数を呼ぶ。
*** MemoryContextSetParent [#b9de69d5]
#geshi(c){{
// 引数1:
extern ForeignServer *GetForeignServer(Oid serverid);
extern void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent);
}}
- 説明
*** GetMemoryChunkSpace [#h49cf6cc]
#geshi(c){{
// 引数1:
extern Size GetMemoryChunkSpace(void *pointer);
}}
- 説明
*** GetMemoryChunkContext [#s051b011]
#geshi(c){{
// 引数1:
extern MemoryContext GetMemoryChunkContext(void *pointer);
}}
- 説明
*** MemoryContextGetParent [#o8a8b1a8]
#geshi(c){{
// 引数1:
extern MemoryContext MemoryContextGetParent(MemoryContext context);
}}
- 説明
*** MemoryContextIsEmpty [#lac3b573]
#geshi(c){{
// 引数1:
extern bool MemoryContextIsEmpty(MemoryContext context);
}}
- 説明
*** MemoryContextStats [#p2c2599b]
#geshi(c){{
// 引数1:
extern void MemoryContextStats(MemoryContext context);
}}
- 説明
*** MemoryContextAllowInCriticalSection [#l9fe4341]
#geshi(c){{
// 引数1:
extern void MemoryContextAllowInCriticalSection(MemoryContext context, bool allow);
}}
- 説明
*** MemoryContextCheck [#ka9bb5bd]
#geshi(c){{
// 引数1:
extern void MemoryContextCheck(MemoryContext context);
}}
- 説明
*** MemoryContextContains [#n111b2d3]
#geshi(c){{
// 引数1:
extern bool MemoryContextContains(MemoryContext context, void *pointer);
}}
- 説明
*** MemoryContextCreate [#a79de8dc]
#geshi(c){{
// 引数1:
extern MemoryContext MemoryContextCreate(NodeTag tag, Size size,
MemoryContextMethods *methods,
MemoryContext parent,
const char *name);
}}
- 説明
*** AllocSetContextCreate [#lc8a5772]
#geshi(c){{
// 引数1:
extern MemoryContext AllocSetContextCreate(MemoryContext parent,
const char *name,
Size minContextSize,
Size initBlockSize,
Size maxBlockSize);
}}
* サンプルプログラム [#j0b18196]
#geshi(c){{
// sample
}}
* 参考・関連 [#vceb7bae]
- [[aset.c>https://doxygen.postgresql.org/aset_8c.html]] - on doxygen.postgresql.org
- [[mcxt.c>https://doxygen.postgresql.org/mcxt_8c.html]] - on doxygen.postgresql.org
- [[palloc.h>PostgreSQL/開発/include/utils/palloc.h]]
&size(12){&color(white,orange){ 関連 };};
#related
* コメント [#m0e0ed05]
#comment