A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
there were no difference between __mmalloc_free and mfree anymore; merge them
[simgrid.git]
/
src
/
xbt
/
mmalloc
/
mfree.c
diff --git
a/src/xbt/mmalloc/mfree.c
b/src/xbt/mmalloc/mfree.c
index
41eefb1
..
bb7bd00
100644
(file)
--- 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. */
/* 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;
{
int type;
size_t block;
@@
-23,6
+24,9
@@
void __mmalloc_free(struct mdesc *mdp, void *ptr)
struct list *prev, *next;
int it;
struct list *prev, *next;
int it;
+ if (ptr == NULL)
+ return;
+
block = BLOCK(ptr);
if ((char *) ptr < (char *) mdp->heapbase || block > mdp->heapsize) {
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;
}
}
break;
}
}
-
-/* Return memory to the heap. */
-
-void mfree(xbt_mheap_t mdp, void *ptr)
-{
- if (ptr != NULL)
- __mmalloc_free(mdp, ptr);
-}