palloc.h

来自「关系型数据库 Postgresql 6.5.2」· C头文件 代码 · 共 42 行

H
42
字号
/*------------------------------------------------------------------------- * * palloc.h *	  POSTGRES memory allocator definitions. * * * Copyright (c) 1994, Regents of the University of California * * $Id: palloc.h,v 1.9 1999/05/25 16:14:56 momjian Exp $ * *------------------------------------------------------------------------- */#ifndef PALLOC_H#define PALLOC_H#include "c.h"#ifdef PALLOC_IS_MALLOC#define palloc(s)	  malloc(s)#define pfree(p)	  free(p)#define repalloc(p,s) realloc((p),(s))#else							/* ! PALLOC_IS_MALLOC *//* ---------- * In the case we use memory contexts, use macro's for palloc() etc. * ---------- */#include "utils/mcxt.h"#define palloc(s)	  ((void *)MemoryContextAlloc(CurrentMemoryContext,(Size)(s)))#define pfree(p)	  MemoryContextFree(CurrentMemoryContext,(Pointer)(p))#define repalloc(p,s) ((void *)MemoryContextRealloc(CurrentMemoryContext,(Pointer)(p),(Size)(s)))#endif	 /* PALLOC_IS_MALLOC *//* like strdup except uses palloc */extern char *pstrdup(char *pointer);#endif	 /* PALLOC_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?