Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : remove unnecessary memset on free fragments, already done in mmalloc
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Thu, 12 Jul 2012 10:03:42 +0000 (12:03 +0200)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Thu, 12 Jul 2012 10:03:42 +0000 (12:03 +0200)
src/xbt/mmalloc/mfree.c

index fae6ed0..8211efc 100644 (file)
@@ -51,8 +51,6 @@ void mfree(struct mdesc *mdp, void *ptr)
     mdp -> heapstats.bytes_free +=
       mdp -> heapinfo[block].busy_block.size * BLOCKSIZE;
 
-    memset(ptr, 0, mdp -> heapinfo[block].busy_block.size * BLOCKSIZE);
-    
     /* Find the free cluster previous to this one in the free list.
        Start searching at the last block referenced; this may benefit
        programs with locality of allocation.  */
@@ -146,9 +144,6 @@ void mfree(struct mdesc *mdp, void *ptr)
     mdp -> heapstats.chunks_free++;
     mdp -> heapstats.bytes_free += 1 << type;
 
-    memset(ptr, 0, 1 << type);
-
-    
     /* Get the address of the first free fragment in this block.  */
     prev = (struct list *)
       ((char *) ADDRESS(block) +