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

Ulrich Prinz uprinz2 at netscape.net
Sun Feb 7 11:54:52 CET 2010


Hi Malte,

As not everyone is deep inside the code at any place, it would be fine 
to make some more explanations, why and what you try to do with this 
change. I think it might be a bug and someone forgot to include the 
debug features in the function. But it's always difficult to rate a 
report without further information.

Thanks in advance and best regards,
Ulrich

Malte Marwedel schrieb:
> 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
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list