Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Further simplify the mmallocs, and improve its introspection abilities
[simgrid.git] / src / xbt / mmalloc / mcalloc.c
index a033bc0..6c94d46 100644 (file)
@@ -7,34 +7,20 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <sys/types.h>  /* GCC on HP/UX needs this before string.h. */
-#include <string.h>    /* Prototypes for memcpy, memmove, memset, etc */
+#include <sys/types.h>          /* GCC on HP/UX needs this before string.h. */
+#include <string.h>             /* Prototypes for memcpy, memmove, memset, etc */
 
 #include "mmprivate.h"
 
 /* Allocate an array of NMEMB elements each SIZE bytes long.
    The entire array is initialized to zeros.  */
 
-void *
-mcalloc (void *md, register size_t nmemb, register size_t size)
+void *mcalloc(xbt_mheap_t md, register size_t nmemb, register size_t size)
 {
-  register voidresult;
+  register void *result;
 
-  if ((result = mmalloc (md, nmemb * size)) != NULL)
-    {
-      memset (result, 0, nmemb * size);
-    }
+  if ((result = mmalloc(md, nmemb * size)) != NULL) {
+    memset(result, 0, nmemb * size);
+  }
   return (result);
 }
-
-/* When using this package, provide a version of malloc/realloc/free built
-   on top of it, so that if we use the default sbrk() region we will not
-   collide with another malloc package trying to do the same thing, if
-   the application contains any "hidden" calls to malloc/realloc/free (such
-   as inside a system library). */
-
-void*
-calloc (size_t nmemb, size_t size)
-{
-  return (mcalloc ((void*) NULL, nmemb, size));
-}