I appears that the memory allocation function uese 16 bytes, not 12 as stated in the documentation.
#define NUM_BOXES 5 U32 mpool[(NUM_BOXES * sizeof(U32)/4) + 3];
fails the assert in the following code where
#define NUM_BOXES 5 U32 mpool[(NUM_BOXES * sizeof(U32)/4) + 4];
passes
void membox_test (void) { U8 *box; U8 i; _init_box (mpool, sizeof (mpool), sizeof(U32)); while(1) { box = _alloc_box (mpool); if(box == NULL)break; i++; } assert(i==NUM_BOXES) }
can anyone confirm this?