/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* Return memory to the heap. */
void mfree(struct mdesc *mdp, void *ptr)
{
/* Return memory to the heap. */
void mfree(struct mdesc *mdp, void *ptr)
{
if ((char *) ptr < (char *) mdp->heapbase || block > mdp->heapsize) {
fprintf(stderr,"Ouch, this pointer is not mine, I refuse to free it. Give me valid pointers, or give me death!!\n");
abort();
}
if ((char *) ptr < (char *) mdp->heapbase || block > mdp->heapsize) {
fprintf(stderr,"Ouch, this pointer is not mine, I refuse to free it. Give me valid pointers, or give me death!!\n");
abort();
}
- if(MC_is_active()){
- if(mdp->heapinfo[block].busy_block.ignore > 0)
- MC_remove_ignore_heap(ptr, mdp -> heapinfo[block].busy_block.busy_size);
- }
+ if (MC_is_active() && mdp->heapinfo[block].busy_block.ignore > 0)
+ MC_unignore_heap(ptr, mdp->heapinfo[block].busy_block.busy_size);
/* Find the free cluster previous to this one in the free list.
Start searching at the last block referenced; this may benefit
/* Find the free cluster previous to this one in the free list.
Start searching at the last block referenced; this may benefit
- if(MC_is_active()){
- if(mdp->heapinfo[block].busy_frag.ignore[frag_nb] > 0)
- MC_remove_ignore_heap(ptr, mdp->heapinfo[block].busy_frag.frag_size[frag_nb]);
- }
+ if (MC_is_active() && mdp->heapinfo[block].busy_frag.ignore[frag_nb] > 0)
+ MC_unignore_heap(ptr, mdp->heapinfo[block].busy_frag.frag_size[frag_nb]);