blob: 092501a193064cd941a39a4158ea172ad185f8a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/*-------------------------------------------------------------------------
*
* mcxt.h--
* POSTGRES memory context definitions.
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: mcxt.h,v 1.9 1998/01/24 22:50:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef MCXT_H
#define MCXT_H
#include <nodes/memnodes.h>
extern MemoryContext CurrentMemoryContext;
extern MemoryContext TopMemoryContext;
/*
* MaxAllocSize --
* 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.
*
* This value should not be referenced except in one place in the code.
*
* XXX This should be defined in a file of tunable constants.
*/
#define MaxAllocSize (0xfffffff) /* 16G - 1 */
/*
* prototypes for functions in mcxt.c
*/
extern void EnableMemoryContext(bool on);
extern Pointer MemoryContextAlloc(MemoryContext context, Size size);
extern Pointer MemoryContextRealloc(MemoryContext context,
Pointer pointer,
Size size);
extern void MemoryContextFree(MemoryContext context, Pointer pointer);
extern MemoryContext MemoryContextSwitchTo(MemoryContext context);
extern GlobalMemory CreateGlobalMemory(char *name);
extern void GlobalMemoryDestroy(GlobalMemory context);
#endif /* MCXT_H */
|