pg的内存管理机制一:AllocSet的内存分配
写了PostgreSQL的内存管理机制周一,AllocSet/MemoryContext的内存分配[@more@]1 AllocSet 的内存分配涉及到的方法和数据结构 话说 MemoryContextMethods 结构里的函数实现了pg 里AllocSet 和MemoryContext 的内存管理机制,定义见下面。 typedef struct MemoryContextMethods { void *(*alloc) (MemoryContext context, Size size); /* call this free_p in case someone #define's free() */ void (*free_p) (MemoryContex
pg启动过程中的那些事二:初始化PostmasterContext
写了PostgreSQL启动过程中初始化PostmasterContext的过程、结构等[@more@]1先上个示意图,看一下函数调用过程梗概,中间略过部分细节 前面标3的是初始化PostmasterContext 初始化PostmasterContext的方法调用流程图 2初始化PostmasterContext的过程 话说main()->…->PostmasterMain()->…->MemoryContextInit()->AllocSetContextCreate()(“->” 表示调用),初始化完TopMemoryContext和ErrorContext,这之后,main()->…->PostmasterMain()->AllocSetContextCreate()初始化PostmasterContext,P