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: memutils.h
/*------------------------------------------------------------------------- * * memutils.h * This file contains declarations for memory allocation utility * functions. These are functions that are not quite widely used * enough to justify going in utils/palloc.h, but are still part * of the API of the memory management subsystem. * * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/utils/memutils.h * *------------------------------------------------------------------------- */ #ifndef MEMUTILS_H #define MEMUTILS_H #include "nodes/memnodes.h" /* * MaxAllocSize * Quasi-arbitrary limit on size of allocations. * * Note: * There is no guarantee that allocations smaller than MaxAllocSize * will succeed. Allocation requests larger than MaxAllocSize will * be summarily denied. * * XXX This is deliberately chosen to correspond to the limiting size * of varlena objects under TOAST. See VARSIZE_4B() and related macros * in postgres.h. Many datatypes assume that any allocatable size can * be represented in a varlena header. * * XXX Also, various places in aset.c assume they can compute twice an * allocation's size without overflow, so beware of raising this. */ #define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */ #define AllocSizeIsValid(size) ((Size) (size) <= MaxAllocSize) /* * All chunks allocated by any memory context manager are required to be * preceded by a StandardChunkHeader at a spacing of STANDARDCHUNKHEADERSIZE. * A currently-allocated chunk must contain a backpointer to its owning * context as well as the allocated size of the chunk. The backpointer is * used by pfree() and repalloc() to find the context to call. The allocated * size is not absolutely essential, but it's expected to be needed by any * reasonable implementation. */ typedef struct StandardChunkHeader { MemoryContext context; /* owning context */ Size size; /* size of data space allocated in chunk */ #ifdef MEMORY_CONTEXT_CHECKING /* when debugging memory usage, also store actual requested size */ Size requested_size; #endif } StandardChunkHeader; #define STANDARDCHUNKHEADERSIZE MAXALIGN(sizeof(StandardChunkHeader)) /* * Standard top-level memory contexts. * * Only TopMemoryContext and ErrorContext are initialized by * MemoryContextInit() itself. */ extern PGDLLIMPORT MemoryContext TopMemoryContext; extern PGDLLIMPORT MemoryContext ErrorContext; extern PGDLLIMPORT MemoryContext PostmasterContext; extern PGDLLIMPORT MemoryContext CacheMemoryContext; extern PGDLLIMPORT MemoryContext MessageContext; extern PGDLLIMPORT MemoryContext TopTransactionContext; extern PGDLLIMPORT MemoryContext CurTransactionContext; /* This is a transient link to the active portal's memory context: */ extern PGDLLIMPORT MemoryContext PortalContext; /* * Memory-context-type-independent functions in mcxt.c */ extern void MemoryContextInit(void); extern void MemoryContextReset(MemoryContext context); extern void MemoryContextDelete(MemoryContext context); extern void MemoryContextResetChildren(MemoryContext context); extern void MemoryContextDeleteChildren(MemoryContext context); extern void MemoryContextResetAndDeleteChildren(MemoryContext context); extern void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent); extern Size GetMemoryChunkSpace(void *pointer); extern MemoryContext GetMemoryChunkContext(void *pointer); extern MemoryContext MemoryContextGetParent(MemoryContext context); extern bool MemoryContextIsEmpty(MemoryContext context); extern void MemoryContextStats(MemoryContext context); #ifdef MEMORY_CONTEXT_CHECKING extern void MemoryContextCheck(MemoryContext context); #endif extern bool MemoryContextContains(MemoryContext context, void *pointer); /* * This routine handles the context-type-independent part of memory * context creation. It's intended to be called from context-type- * specific creation routines, and noplace else. */ extern MemoryContext MemoryContextCreate(NodeTag tag, Size size, MemoryContextMethods *methods, MemoryContext parent, const char *name); /* * Memory-context-type-specific functions */ /* aset.c */ extern MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize); /* * Recommended default alloc parameters, suitable for "ordinary" contexts * that might hold quite a lot of data. */ #define ALLOCSET_DEFAULT_MINSIZE 0 #define ALLOCSET_DEFAULT_INITSIZE (8 * 1024) #define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024) /* * Recommended alloc parameters for "small" contexts that are not expected * to contain much data (for example, a context to contain a query plan). */ #define ALLOCSET_SMALL_MINSIZE 0 #define ALLOCSET_SMALL_INITSIZE (1 * 1024) #define ALLOCSET_SMALL_MAXSIZE (8 * 1024) /* * Threshold above which a request in an AllocSet context is certain to be * allocated separately (and thereby have constant allocation overhead). * Few callers should be interested in this, but tuplesort/tuplestore need * to know it. */ #define ALLOCSET_SEPARATE_THRESHOLD 8192 #endif /* MEMUTILS_H */
Save