Don't use memset(3) after `GC_MALLOC ()' calls.
authorLudovic Courtès <ludo@gnu.org>
Mon, 26 Oct 2009 09:25:38 +0000 (10:25 +0100)
committerLudovic Courtès <ludo@gnu.org>
Mon, 26 Oct 2009 09:25:38 +0000 (10:25 +0100)
* libguile/gc-malloc.c (scm_gc_calloc): Don't use memset(3) as it's not
  needed.  Reported by Andy Wingo.

libguile/gc-malloc.c

index 0e60eba..669f789 100644 (file)
@@ -205,10 +205,8 @@ scm_gc_malloc (size_t size, const char *what)
 void *
 scm_gc_calloc (size_t size, const char *what)
 {
-  void *ptr = scm_gc_malloc (size, what);
-  if (size)
-    memset (ptr, 0x0, size);
-  return ptr;
+  /* `GC_MALLOC ()' always returns a zeroed buffer.  */
+  return scm_gc_malloc (size, what);
 }