diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c index c88a8b631..219aac66b 100644 --- a/libguile/gc-malloc.c +++ b/libguile/gc-malloc.c @@ -63,20 +63,6 @@ do_calloc (size_t n, size_t size) return calloc (n, size); } -static void* -do_gc_malloc (size_t size, const char *what) -{ - /* Ensure nonzero size to be compatible with always-nonzero return of - glibc malloc. */ - return GC_MALLOC (size ? size : sizeof (void *)); -} - -static void* -do_gc_realloc (void *from, size_t size, const char *what) -{ - return GC_REALLOC (from, size ? size : sizeof (void *)); -} - /* Function for non-cell memory management. @@ -187,20 +173,21 @@ scm_gc_malloc_pointerless (size_t size, const char *what) void * scm_gc_malloc (size_t size, const char *what) { - return do_gc_malloc (size, what); + return scm_inline_gc_malloc (SCM_I_CURRENT_THREAD, size ? size : 1); } void * scm_gc_calloc (size_t size, const char *what) { - /* `GC_MALLOC ()' always returns a zeroed buffer. */ - return do_gc_malloc (size, what); + /* `scm_gc_malloc ()' always returns a zeroed buffer. */ + return scm_gc_malloc (size, what); } void * scm_gc_realloc (void *mem, size_t old_size, size_t new_size, const char *what) { - return do_gc_realloc (mem, new_size, what); + /* FIXME: Remove me. */ + return GC_REALLOC (mem, new_size ? new_size : sizeof (void *)); } char *