summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorkeithp <keithp>2000-05-06 22:23:48 +0000
committerkeithp <keithp>2000-05-06 22:23:48 +0000
commitb5fd9f6525d7a236340de639ea7a947de512b3cb (patch)
tree63a5334143205d5be16d813f94baf5e17b97c02a /util
parent6465afb13863b1ee2c571ba9471faa73be840166 (diff)
Add FindLeakValidateAlways to verify pool at each malloc/free
Diffstat (limited to 'util')
-rw-r--r--util/memleak/fmalloc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/util/memleak/fmalloc.c b/util/memleak/fmalloc.c
index 341e8cffb..ddb85a155 100644
--- a/util/memleak/fmalloc.c
+++ b/util/memleak/fmalloc.c
@@ -22,7 +22,7 @@ in this Software without prior written authorization from The Open Group.
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/util/memleak/fmalloc.c,v 3.5 1999/12/27 00:56:41 robin Exp $ */
+/* $XFree86: xc/util/memleak/fmalloc.c,v 3.6 2000/02/12 03:40:07 dawes Exp $ */
/*
@@ -157,6 +157,7 @@ unsigned long FindLeakAllocBreakpoint = ~0;
unsigned long FindLeakFreeBreakpoint = ~0;
unsigned long FindLeakTime;
int FindLeakCheckAlways = 0;
+int FindLeakValidateAlways = 0;
static void MarkActiveBlock ();
static int tree_insert (), tree_delete ();
@@ -550,6 +551,11 @@ malloc (desiredsize)
endOfStaticMemory = (mem *) sbrk(0);
if (FindLeakCheckAlways)
CheckMemory ();
+ else if (FindLeakValidateAlways)
+ {
+ ValidateActiveMemory ();
+ ValidateFreedMemory ();
+ }
size = RoundUp(desiredsize);
totalsize = TotalSize (size);
@@ -631,6 +637,11 @@ free (p)
AddFreedBlock (h);
if (FindLeakCheckAlways)
CheckMemory ();
+ else if (FindLeakValidateAlways)
+ {
+ ValidateActiveMemory ();
+ ValidateFreedMemory ();
+ }
}
char *