/* 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;
+ mdp->heapinfo[block].busy_frag.equal_to[frag_nb] = NULL;
+
// 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) {
mdp->heapinfo[block].type = 0;
mdp->heapinfo[block].busy_block.size = 1;
mdp->heapinfo[block].busy_block.busy_size = 0;
+ mdp->heapinfo[block].busy_block.equal_to = NULL;
/* Keep the statistics accurate. */
mdp -> heapstats.chunks_used++;
/* mark the space previously occupied by the block info as free by first marking it
* as occupied in the regular way, and then freing it */
- for (it=0; it<BLOCKIFY(mdp->heapsize * sizeof(malloc_info)); it++)
+ for (it=0; it<BLOCKIFY(mdp->heapsize * sizeof(malloc_info)); it++){
newinfo[BLOCK(oldinfo)+it].type = 0;
+ newinfo[BLOCK(oldinfo)+it].busy_block.ignore = 0;
+ newinfo[BLOCK(oldinfo+it)].busy_block.equal_to = NULL;
+ }
newinfo[BLOCK(oldinfo)].busy_block.size = BLOCKIFY(mdp->heapsize * sizeof(malloc_info));
newinfo[BLOCK(oldinfo)].busy_block.busy_size = size;
- newinfo[BLOCK(oldinfo)].busy_block.ignore = 0;
- newinfo[BLOCK(oldinfo)].busy_block.equal_to = NULL;
//newinfo[BLOCK(oldinfo)].busy_block.bt_size = 0;// FIXME setup the backtrace
mfree(mdp, (void *) oldinfo);
mdp->heapsize = newsize;
int it;
/* The new size is smaller; return excess memory to the free list. */
//printf("(%s) return excess memory...",xbt_thread_self_name());
- for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++)
+ for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++){
mdp->heapinfo[it].type = 0; // FIXME that should be useless, type should already be 0 here
+ mdp->heapinfo[it].busy_block.ignore = 0;
+ mdp->heapinfo[it].busy_block.equal_to = NULL;
+ }
mdp->heapinfo[block + blocks].busy_block.size
= mdp->heapinfo[block].busy_block.size - blocks;