Eneboo - Documentación para desarrolladores
|
A segregated-fits collection of (homogeneous) heaps. Más...
#include <segheap.h>
A segregated-fits collection of (homogeneous) heaps.
Note that one extra heap is used for objects that are "too big".
NumBins | The number of bins (subheaps). |
getSizeClass | Function to compute size class from size. |
getClassMaxSize | Function to compute the largest size for a given size class. |
LittleHeap | The subheap class. |
BigHeap | The parent class, used for "big" objects. |
Example:
int myFunc (size_t sz); // The size-to-class function.
size_t myFunc2 (int); // The class-to-size function.
// The heap. Use freelists for these small objects,
// but defer to malloc for large objects.
SegHeap<4, myFunc, myFunc2, freelistHeap<mallocHeap>, mallocHeap> mySegHeap;