Fix memleaks in the memleak library :-) Also debug the libs by default

since if we are doing this kind of debugging we really might want to inspect
the library internals too.
This commit is contained in:
niklas 1999-04-20 09:01:32 +00:00
parent f7e6258e44
commit 26aa282203
2 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,5 @@
--- Makefile.orig Thu Aug 21 02:17:10 1997
+++ Makefile Mon Apr 19 23:34:04 1999
+++ Makefile Tue Apr 20 09:43:01 1999
@@ -8,14 +8,40 @@
# c++ interface to gc.a
# cord/de - builds dumb editor based on cords.
@ -17,7 +17,7 @@
+# The new c++-t and c++-nt (test and notest) are because we don't want
+# to fill anyone's log with leak messages! - MMCG
+
+CFLAGS= -O -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DATOMIC_UNCOLLECTABLE \
+CFLAGS= -g -O -DNO_SIGNALS -DALL_INTERIOR_POINTERS -DATOMIC_UNCOLLECTABLE \
+ -DNO_EXECUTE_PERMISSION -DSILENT -DREDIRECT_MALLOC=GC_malloc
+
+LEAKFLAGS=$(CFLAGS) -DFIND_LEAK

View File

@ -0,0 +1,19 @@
--- dbg_mlc.c.orig Tue Apr 22 20:06:56 1997
+++ dbg_mlc.c Tue Apr 20 09:59:53 1999
@@ -386,7 +386,7 @@
{
register GC_PTR base = GC_base(p);
register ptr_t clobbered;
- register GC_PTR result = GC_debug_malloc(lb, s, i);
+ register GC_PTR result;
register size_t copy_sz = lb;
register size_t old_sz;
register hdr * hhdr;
@@ -432,6 +432,7 @@
if (old_sz < copy_sz) copy_sz = old_sz;
if (result == 0) return(0);
BCOPY(p, result, copy_sz);
+ GC_debug_free(p);
return(result);
}