Main Page | Struct List | File List | Struct Members | File Members

_FixHeap Struct Reference

#include <fixheap.h>

List of all members.

Public Attributes

char * name
unsigned long nodeSize
int verbose


Detailed Description

fixed size node heap manager:

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.


Member Data Documentation

char* _FixHeap::name
 

unsigned long _FixHeap::nodeSize
 

int _FixHeap::verbose
 


The documentation for this struct was generated from the following file:
Generated on Thu Jan 27 11:30:34 2005 for STACCATO_PROJECT by  doxygen 1.4.0