Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I don't need an extra file just to define calloc when it can be inlined that easily
[simgrid.git] / src / xbt / mmalloc / mm_legacy.c
index b353835..02e04b6 100644 (file)
@@ -49,8 +49,10 @@ void *calloc(size_t nmemb, size_t size)
   xbt_mheap_t mdp = __mmalloc_current_heap ?: (xbt_mheap_t) mmalloc_preinit();
 
   LOCK(mdp);
-  void *ret = mcalloc(mdp, nmemb,size);
+  void *ret = mmalloc(mdp, nmemb*size);
   UNLOCK(mdp);
+  memset(ret, 0, nmemb * size);
+
 
   return ret;
 }