/* 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;
struct list *prev, *next;
int it;
+ if (ptr == NULL)
+ return;
+
block = BLOCK(ptr);
if ((char *) ptr < (char *) mdp->heapbase || block > mdp->heapsize) {
break;
}
}
-
-/* Return memory to the heap. */
-
-void mfree(xbt_mheap_t mdp, void *ptr)
-{
- if (ptr != NULL)
- __mmalloc_free(mdp, ptr);
-}
newinfo[BLOCK(oldinfo)].type = 0;
newinfo[BLOCK(oldinfo)].busy_block.size = BLOCKIFY(mdp->heapsize * sizeof(malloc_info));
newinfo[BLOCK(oldinfo)].busy_block.busy_size = size;
- __mmalloc_free(mdp, (void *) oldinfo);
+ mfree(mdp, (void *) oldinfo);
mdp->heapsize = newsize;
}
size_t heaplimit;
/* Block information table.
- Allocated with malign/__mmalloc_free (not mmalloc/mfree). */
+ Allocated with malign/mfree (not mmalloc/mfree). */
/* Table indexed by block number giving per-block information. */
malloc_info *heapinfo;
#define MMALLOC_ANONYMOUS (1 << 1) /* Use anonymous mapping */
#define MMALLOC_INITIALIZED (1 << 2) /* Initialized mmalloc */
-/* Internal version of `mfree' used in `morecore'. */
-
-extern void __mmalloc_free(struct mdesc *mdp, void *ptr);
-
/* A default malloc descriptor for the single sbrk() managed region. */
extern struct mdesc *__mmalloc_default_mdp;