64#define MCXT_ALLOC_HUGE 0x01
65#define MCXT_ALLOC_NO_OOM 0x02
66#define MCXT_ALLOC_ZERO 0x04
74 Size size,
int flags);
84 Size size,
int flags);
86extern void pfree(
void *pointer);
107#define palloc_object(type) ((type *) palloc(sizeof(type)))
108#define palloc0_object(type) ((type *) palloc0(sizeof(type)))
113#define palloc_array(type, count) ((type *) palloc_mul(sizeof(type), count))
114#define palloc0_array(type, count) ((type *) palloc0_mul(sizeof(type), count))
115#define palloc_array_extended(type, count, flags) ((type *) palloc_mul_extended(sizeof(type), count, flags))
121#define repalloc_array(pointer, type, count) ((type *) repalloc_mul(pointer, sizeof(type), count))
122#define repalloc0_array(pointer, type, oldcount, count) ((type *) repalloc0(pointer, mul_size(sizeof(type), oldcount), mul_size(sizeof(type), count)))
123#define repalloc_array_extended(pointer, type, count, flags) ((type *) repalloc_mul_extended(pointer, sizeof(type), count, flags))
158extern char *
pstrdup(
const char *in);
161extern char *
pchomp(
const char *in);
#define pg_attribute_printf(f, a)
void MemoryContextUnregisterResetCallback(MemoryContext context, MemoryContextCallback *cb)
char * MemoryContextStrdup(MemoryContext context, const char *string)
void * palloc_mul_extended(Size s1, Size s2, int flags)
void * MemoryContextAlloc(MemoryContext context, Size size)
void * MemoryContextAllocZero(MemoryContext context, Size size)
Size add_size(Size s1, Size s2)
char * pstrdup(const char *in)
void MemoryContextRegisterResetCallback(MemoryContext context, MemoryContextCallback *cb)
char * psprintf(const char *fmt,...) pg_attribute_printf(1
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
pg_nodiscard void * repalloc_huge(void *pointer, Size size)
void pfree(void *pointer)
pg_nodiscard void * repalloc_mul(void *p, Size s1, Size s2)
void * palloc0(Size size)
void * MemoryContextAllocAligned(MemoryContext context, Size size, Size alignto, int flags)
void(* MemoryContextCallbackFunction)(void *arg)
char * pchomp(const char *in)
Size mul_size(Size s1, Size s2)
struct MemoryContextData * MemoryContext
void * MemoryContextAllocExtended(MemoryContext context, Size size, int flags)
void * palloc0_mul(Size s1, Size s2)
char * pnstrdup(const char *in, Size len)
void * palloc_extended(Size size, int flags)
pg_nodiscard void * repalloc_mul_extended(void *p, Size s1, Size s2, int flags)
pg_nodiscard void * repalloc_extended(void *pointer, Size size, int flags)
char size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3
void * palloc_mul(Size s1, Size s2)
pg_nodiscard void * repalloc0(void *pointer, Size oldsize, Size size)
pg_nodiscard void * repalloc(void *pointer, Size size)
void * MemoryContextAllocHuge(MemoryContext context, Size size)
PGDLLIMPORT MemoryContext CurrentMemoryContext
void * palloc_aligned(Size size, Size alignto, int flags)
static char buf[DEFAULT_XLOG_SEG_SIZE]
struct MemoryContextCallback * next
MemoryContextCallbackFunction func