[En-Nut-Discussion] Suggested small changes for heap.c

Malte Marwedel m.marwedel at onlinehome.de
Wed Feb 3 14:52:03 CET 2010


Hello,
In NutHeapRootFree(), I think
NUTPANIC("Trying to release free heap memory at %p in %s:%d\n", file, line);
should be
NUTPANIC("Trying to release free heap memory at %p in %s:%d\n", block, 
file, line);

And in NutHeapRootAvailable() and NutHeapRootRegionAvailable():
rc += node->hn_size - NUT_HEAP_OVERHEAD;
and
return rc - NUT_HEAP_OVERHEAD;
I think the following would make more sense:
rc += node->hn_size - (NUT_HEAP_OVERHEAD + 2 * NUTMEM_GUARD_BYTES);
and
return rc - (NUT_HEAP_OVERHEAD + 2 * NUTMEM_GUARD_BYTES);

Malte



More information about the En-Nut-Discussion mailing list