server_heap_t * server_heap_new(const char *label, int unit_size, int units_per_chunk, int maximum_units, server_heap_options_t options)
Returns a heap pointer for use with the rest of the heap API or NULL on failure.
unit_size specifies how large the individual allocations are to be.
units_per_chunk specifies how many units to grow by whenever heap growth ocurrs. This is the starting value if SERVER_HEAP_GROW_EXPONENTIALLY is set.
The label is a simple name you should use to give this instance some context, most of the SeverKit primitives allow you to name them, this is so when ServerKit reports statistics it can give some meaningful identities to the numbers.
The currently supported options for ServerKit heaps are:
Like most options in ServerKit, these are bitwise fields which you may combine by OR-ing them together, or just specify 0 if you don't want to set any options. Most of the time you will probably want to set the exponential growth option, it makes the heap growth more efficient at the cost of some memory... but it really depends on what you need. The shrinking option is currently not implemented but should still be specified where desired.
2007-12-06