diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/config.h.in | 8 | ||||
| -rw-r--r-- | src/include/nodes/memnodes.h | 5 | ||||
| -rw-r--r-- | src/include/utils/memutils.h | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/include/config.h.in b/src/include/config.h.in index 25e8be291f..583c20dc54 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -8,7 +8,7 @@ * or in config.h afterwards. Of course, if you edit config.h, then your * changes will be overwritten the next time you run configure. * - * $Id: config.h.in,v 1.124 2000/07/09 13:14:13 petere Exp $ + * $Id: config.h.in,v 1.125 2000/07/11 14:30:30 momjian Exp $ */ #ifndef CONFIG_H @@ -229,6 +229,12 @@ #define CLOBBER_FREED_MEMORY #endif +/* Define this to check memory leaks + */ +#ifdef USE_ASSERT_CHECKING +#define MEMORY_CONTEXT_CHECKING +#endif + /* Define this to force all parse and plan trees to be passed through * copyObject(), to facilitate catching errors and omissions in copyObject(). * XXX For 7.1 development, define this automatically if --enable-cassert. diff --git a/src/include/nodes/memnodes.h b/src/include/nodes/memnodes.h index abc38e5c60..4296795e5d 100644 --- a/src/include/nodes/memnodes.h +++ b/src/include/nodes/memnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: memnodes.h,v 1.17 2000/06/28 03:33:15 tgl Exp $ + * $Id: memnodes.h,v 1.18 2000/07/11 14:30:34 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -42,6 +42,9 @@ typedef struct MemoryContextMethods void (*init) (MemoryContext context); void (*reset) (MemoryContext context); void (*delete) (MemoryContext context); +#ifdef MEMORY_CONTEXT_CHECKING + void (*check) (MemoryContext context); +#endif void (*stats) (MemoryContext context); } MemoryContextMethods; diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h index cbabdbf275..be322cbccc 100644 --- a/src/include/utils/memutils.h +++ b/src/include/utils/memutils.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: memutils.h,v 1.36 2000/06/28 03:33:33 tgl Exp $ + * $Id: memutils.h,v 1.37 2000/07/11 14:30:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -48,6 +48,9 @@ typedef struct StandardChunkHeader { MemoryContext context; /* owning context */ Size size; /* size of data space allocated in chunk */ +#ifdef MEMORY_CONTEXT_CHECKING + Size data_size; /* real data size (without align) */ +#endif } StandardChunkHeader; #define STANDARDCHUNKHEADERSIZE MAXALIGN(sizeof(StandardChunkHeader)) @@ -78,6 +81,7 @@ extern void MemoryContextResetChildren(MemoryContext context); extern void MemoryContextDeleteChildren(MemoryContext context); extern void MemoryContextResetAndDeleteChildren(MemoryContext context); extern void MemoryContextStats(MemoryContext context); +extern void MemoryContextCheck(MemoryContext context); extern bool MemoryContextContains(MemoryContext context, void *pointer); /* |
