#include <fixheap.h>
Public Attributes | |
char * | name |
unsigned long | nodeSize |
int | verbose |
most fast Unix malloc packages allocate blocks in only sizes that are a power of 2 bytes; for a program that uses a LOT of small structures (like TETRA) this greatly increase memory usage; for example, a 38 byte structure will typically be allocated in a 64 byte block; the fixed node size heap manager allocates blocks in a large array, and then maintains a free list for this allocation, thus the system malloc overhead is only bore for a block of allocations, rather than for each; the other advantage of a fixed size allocator is better memory reference locality - since the overhead is moved away from the allocated nodes
do not use this for infrequently used nodes; to compute the nodesPerAlloc, use a variant of the following equation
nodesPerAlloc = floor((64k - sys_overhead - FixHeap_overhead)/nodeSize)
where: sys_overhead: is the system malloc overhead (always less 64 bytes on the DECstation's default malloc package), make this conservatively large! FixHeap_overhead: is the fixed head size manager's overhead, which is always less than 32 bytes
Increase or decrease the mass allocation size to match the usage of the particular node type.
|
|
|
|
|
|