[En-Nut-Discussion] question about heap.c

Nathan Moore nategoose at gmail.com
Mon Mar 17 16:16:39 CET 2008


I was looking over the heap.c code and ran across MEMOVHD and
something jumped out at me.

>From line 141:
#define MEMOVHD (sizeof(size_t) + sizeof(0xDEADBEEF))

As I understand it this is supposed to account for the size of the
memory chunk and the size of
the pointer to the next pointer -- ie, sizeof(struct HEAPNODE).

What stood out to me about this was that on AVR sizeof(0xDEADBEEF) is
twice as big as
sizeof(void *).  Is the overhead really too big on AVR or am I
misunderstanding something?

Nathan



More information about the En-Nut-Discussion mailing list