Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : store equality detected in heap comparison if fragment or block numbe...
[simgrid.git] / src / xbt / mmalloc / mmalloc.c
index e6f796d..be68060 100644 (file)
@@ -184,7 +184,6 @@ void *mmalloc(xbt_mheap_t mdp, size_t size)
       block = BLOCK(result);
       for (i = 1; i < (size_t) (BLOCKSIZE >> log); ++i) {
         mdp->heapinfo[block].busy_frag.frag_size[i] = 0;
-        mdp->heapinfo[block].busy_frag.equal_to[i] = -1;
         next = (struct list *) ((char *) result + (i << log));
         next->next = mdp->fraghead[log].next;
         next->prev = &mdp->fraghead[log];
@@ -289,6 +288,8 @@ void *mmalloc(xbt_mheap_t mdp, size_t size)
     mdp -> heapstats.chunks_used++;
     mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
     mdp -> heapstats.bytes_free -= blocks * BLOCKSIZE;
+
+    memset(result, 0, requested_size);
   }
   //printf("(%s) Done mallocing. Result is %p\n",xbt_thread_self_name(),result);fflush(stdout);
   return (result);