Defined in file: hzSMAR.h

Segmented Memory Allocation Regime

Constructors/Detructors

hzSMAR*hzSMAR(void)
hzSMAR*hzSMAR(uint32_t nCode)
NULL-TYPEhzSMAR(uint32_t nCode)
void~hzSMAR(void)

Public Methods:

uint32_tAlloc(uint32_t nSize)Allocate string space. The actual space allocated will be sufficient for a string of length nSize, plus the copy count, length indicator and NULL terminator.
hzEcodeFree(uint32_t ssrAddr)uint32_t nSize, Places object in freelist if it is of one of the precribed sizes, otherwise it frees it from the OS managed heap Returns: None
voidReport(hzChain& report)
unsigned char*Xlate(uint32_t ssrAddr)Translate a 32-bit unsigned string address, to a pointer to an (encoded) string

Member Variables:

hzMapS<uint32_t,void*>m_HeapHeap allocated oversized strings
hzMapS<uint32_t,_smarBloc*>m_SuperMap of 256K superblocks (max of 64K addressable so 16Gb space)
uint32_t*m_arrFLArray of free lists for each size
hzLockSm_lockFlistLock for m_Flists
hzLockSm_lockOsizeLock for allocating/freeing of oversize strings
hzLockSm_lockSblocLock for allocating superblocks
uint64_tm_nAllocNewTotal number of new allocations
uint64_tm_nAllocOldTotal number of allocations from free list
uint32_tm_nCodeDiagnostics
uint32_tm_nLiveLive string population
uint64_tm_nReleasesTotal number of releases
_smarBloc*m_pTopBlockLatest small string space superblock (only one from which new string spaces can be allocated)