((char *) ADDRESS(block) +
(mdp->heapinfo[block].busy_frag.first << type));
- /* Set size used in the fragment to 0 */
frag_nb = RESIDUAL(ptr, BLOCKSIZE) >> type;
if( mdp->heapinfo[block].busy_frag.frag_size[frag_nb] == -1){
THROWF(system_error, 0, "Asked to free a fragment that is already free. I'm puzzled\n");
}
+ /* Set size used in the fragment to -1 */
mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = -1;
if (mdp->heapinfo[block].busy_frag.nfree ==
result = mmalloc(mdp, BLOCKSIZE); // does not return NULL
- /* Link all fragments but the first into the free list, and mark their requested size to 0. */
+ /* Link all fragments but the first into the free list, and mark their requested size to -1. */
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.frag_size[i] = -1;
next = (struct list *) ((char *) result + (i << log));
next->next = mdp->fraghead[log].next;
next->prev = &mdp->fraghead[log];