Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / xbt / mmalloc / mfree.c
index a6735e0..e522919 100644 (file)
@@ -55,7 +55,7 @@ void mfree(struct mdesc *mdp, void *ptr)
       mdp -> heapinfo[block].busy_block.size * BLOCKSIZE;
 
     if(MC_is_active()){
-      if(mdp->heapinfo[block].busy_block.ignore == 1)
+      if(mdp->heapinfo[block].busy_block.ignore > 0)
         MC_remove_ignore_heap(ptr, mdp -> heapinfo[block].busy_block.busy_size);
     }
 
@@ -162,13 +162,14 @@ void mfree(struct mdesc *mdp, void *ptr)
     }
 
     if(MC_is_active()){
-      if(mdp->heapinfo[block].busy_frag.ignore[frag_nb] == 1)
+      if(mdp->heapinfo[block].busy_frag.ignore[frag_nb] > 0)
         MC_remove_ignore_heap(ptr, mdp->heapinfo[block].busy_frag.frag_size[frag_nb]);
     }
 
     /* Set size used in the fragment to -1 */
     mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = -1;
-    
+    mdp->heapinfo[block].busy_frag.ignore[frag_nb] = 0;
+
 //    fprintf(stderr,"nfree:%zu capa:%d\n", mdp->heapinfo[block].busy_frag.nfree,(BLOCKSIZE >> type));
     if (mdp->heapinfo[block].busy_frag.nfree ==
         (BLOCKSIZE >> type) - 1) {