X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/027d955aa752674c7d524a3bba004aaa7af1d0dc..932b32f3ce5bb1d33aff7fa54faf1229ee68eb6d:/src/xbt/mmalloc/mfree.c?ds=sidebyside diff --git a/src/xbt/mmalloc/mfree.c b/src/xbt/mmalloc/mfree.c index 41eefb106d..bb7bd00a68 100644 --- a/src/xbt/mmalloc/mfree.c +++ b/src/xbt/mmalloc/mfree.c @@ -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); -}