Fix --enable-debug-malloc
authorAndy Wingo <wingo@pobox.com>
Sun, 5 Feb 2012 14:55:09 +0000 (15:55 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 5 Feb 2012 14:55:37 +0000 (15:55 +0100)
commit817307ccac5027fd784798bbbf6ffb52e0a5d751
tree2ff2e6316b36d709e442f52255c92ec5262ebb6e
parent13fb25ba0c24a9e7732d2c32dbc882c7d462bce9
Fix --enable-debug-malloc

* libguile/gc-malloc.c (do_realloc, do_calloc, do_gc_malloc)
  (do_gc_malloc_atomic, do_gc_realloc, do_gc_free): Wrap the allocators
  in helper methods.  The non-GC allocators call
  scm_gc_register_allocation, and the GC allocators ensure that
  gc_malloc returns a nonzero value.
  (scm_realloc, scm_calloc): Allow NULL return for malloc(0).  It is
  permitted by POSIX.  Don't wrap in a SCM_SYSCALL; the only possible
  errno is ENOMEM.
  (scm_gc_malloc_pointerless, scm_gc_malloc, scm_gc_calloc):
  (scm_gc_realloc, scm_gc_free, scm_gc_strndump): Use the wrappers.
  Don't call the debug-malloc registrations and deregistrations, as it
  is neither mandatory nor advised to call scm_gc_free.  Fixes
  compilation with debug-malloc.
  (scm_must_free): Don't scm_malloc_unregister.
libguile/gc-malloc.c