PostgreSQL的内存管理机制四:AllocSet/MemoryContext的内存再分配

        话说MemoryContextMethods结构里的函数实现了pg里AllocSet/MemoryContext的内存管理机制,定义见下面。

typedef structMemoryContextMethods

{

     void    *(*alloc) (MemoryContext context, Sizesize);

     /* call this free_p in case someone #define's free() */

     void     (*free_p)(MemoryContext context, void *pointer);

     void    *(*realloc) (MemoryContext context, void *pointer, Size size);

     void     (*init)(MemoryContext context);

     void     (*reset)(MemoryContext context);

     void     (*delete) (MemoryContext context);

     Size     (*get_chunk_space) (MemoryContext context, void *pointer);

     bool     (*is_empty)(MemoryContext context);

     void     (*stats)(Mem

你可能感兴趣的:(PostgreSQL内核,postgresql,delete,扩展)