2 // Heap of fixed size objects, fast to alloc and especially to totally free
10 { uint siz; // element size
11 uint cap; // block capacity in # of elems
12 void **blocks; // list of blocks, next is block[0]
13 void **free; // list of free positions, each contains next
14 uint first; // first free position in current block
15 uint totsize; // total memory allocated here
18 // Creates a heap of elements of size siz
19 heap createHeap (uint siz);
20 // Gets a new element from H
21 void *mallocHeap (heap H);
22 // Frees ptr from heap H
23 void freeHeap (heap H, void *ptr);
24 // Frees everything in heap H
25 void destroyHeap (heap H);