Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
there were no difference between __mmalloc_free and mfree anymore; merge them
[simgrid.git] / src / xbt / mmalloc / mfree.c
index 41eefb1..bb7bd00 100644 (file)
@@ -15,7 +15,8 @@
 /* Return memory to the heap.
    Like `mfree' but don't call a mfree_hook if there is one.  */
 
-void __mmalloc_free(struct mdesc *mdp, void *ptr)
+/* Return memory to the heap.  */
+void mfree(struct mdesc *mdp, void *ptr)
 {
   int type;
   size_t block;
@@ -23,6 +24,9 @@ void __mmalloc_free(struct mdesc *mdp, void *ptr)
   struct list *prev, *next;
   int it;
 
+  if (ptr == NULL)
+         return;
+
   block = BLOCK(ptr);
 
   if ((char *) ptr < (char *) mdp->heapbase || block > mdp->heapsize) {
@@ -163,11 +167,3 @@ void __mmalloc_free(struct mdesc *mdp, void *ptr)
     break;
   }
 }
-
-/* Return memory to the heap.  */
-
-void mfree(xbt_mheap_t mdp, void *ptr)
-{
-  if (ptr != NULL)
-    __mmalloc_free(mdp, ptr);
-}