summaryrefslogtreecommitdiff
path: root/src/include/utils/palloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/utils/palloc.h')
-rw-r--r--src/include/utils/palloc.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/include/utils/palloc.h b/src/include/utils/palloc.h
deleted file mode 100644
index 168ed301977..00000000000
--- a/src/include/utils/palloc.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * 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-2002, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * $Id: palloc.h,v 1.19 2002/06/20 20:29:53 momjian Exp $
- *
- *-------------------------------------------------------------------------
- */
-#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 DLLIMPORT MemoryContext CurrentMemoryContext;
-
-/*
- * Fundamental memory-allocation operations (more are in utils/memutils.h)
- */
-extern void *MemoryContextAlloc(MemoryContext context, Size size);
-
-#define palloc(sz) MemoryContextAlloc(CurrentMemoryContext, (sz))
-
-extern void pfree(void *pointer);
-
-extern void *repalloc(void *pointer, Size size);
-
-extern MemoryContext MemoryContextSwitchTo(MemoryContext context);
-
-/*
- * 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))
-
-#endif /* PALLOC_H */