*** empty log message ***
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Fri, 21 Apr 2000 00:27:52 +0000 (00:27 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Fri, 21 Apr 2000 00:27:52 +0000 (00:27 +0000)
ChangeLog
NEWS
libguile/ChangeLog

index 94329e7..2c66a27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-04-21  Mikael Djurfeldt  <mdj@thalamus.nada.kth.se>
+
+       * acconfig.h (GUILE_DEBUG_MALLOC): New.
+
+       * configure.in: New --enable-debug-malloc configuration option.
+
 2000-03-29  Mikael Djurfeldt  <mdj@thalamus.nada.kth.se>
 
        * acconfig.h (GUILE_PTHREAD_COMPAT): New config variable.
diff --git a/NEWS b/NEWS
index a1f7d10..3cd1859 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,7 +42,7 @@ features:
 
 These are likely to become separate modules some day.
 
-** Added new configure option --enable-debug-freelist
+** New configure option --enable-debug-freelist
 
 This enables a debugging version of SCM_NEWCELL(), and also registers
 an extra primitive, the setter `gc-set-debug-check-freelist!'.
@@ -58,6 +58,24 @@ a garbage collection before each allocation of a cell.  This can
 slow down the interpreter dramatically, so the setter should be used to
 turn on this extra processing only when necessary.
 
+** New configure option --enable-debug-malloc
+
+Include code for debugging of calls to scm_must_malloc/realloc/free.
+
+Checks that
+
+1. objects freed by scm_must_free has been mallocated by scm_must_malloc
+2. objects reallocated by scm_must_realloc has been allocated by
+   scm_must_malloc
+3. reallocated objects are reallocated with the same what string
+
+But, most importantly, it records the number of allocated objects of
+each kind.  This is useful when searching for memory leaks.
+
+A Guile compiled with this option provides the primitive
+`malloc-stats' which returns an alist with pairs of kind and the
+number of objects of that kind.
+
 * Changes to the stand-alone interpreter
 
 ** Dynamic linking now uses libltdl from the libtool package.
index e49aa1b..e3294cf 100644 (file)
@@ -1,3 +1,16 @@
+2000-04-21  Mikael Djurfeldt  <mdj@thalamus.nada.kth.se>
+
+       * gc.c (scm_must_malloc, scm_must_realloc, scm_must_free): Added
+       calls to malloc debugging functions. 
+
+       * init.c (scm_boot_guile_1): Added calls to debug-malloc init
+       functions.
+
+       * Makefile.am: Added debug-malloc.c, debug-malloc.h,
+       debug-malloc.x.
+
+       * debug-malloc.c, debug-malloc.h: New files.
+
 2000-04-20  Dirk Herrmann  <D.Herrmann@tu-bs.de>
 
        * numbers.c (scm_exact_p, scm_odd_p, scm_even_p):  Added