Memory Divider X
MDX = malloc() + free() + Garbage Collection
 All Classes Namespaces Functions Variables Pages
Public Attributes | List of all members
MemoryDividerX::MDXConfiguration Struct Reference

The MDXConfiguration structure gathers together all the configuration information for an MDXPool. More...

Public Attributes

uinta flags
 The flags set here are applied automatically to every malloc() and free() operation. More...
 
uinta fillOnFreeByte
 FLAG_FILL_ON_FREE fills memory with the least significant byte of fillOnFreeByte when it's freed.
 
uinta fillOnMallocByte
 FLAG_FILL_ON_MALLOC fills memory with the least significant byte of fillOnMallocByte when it's allocated.
 
uinta aproxBulkAllocationBytes
 When getting memory in bulk for small chunks, MDX will get it in chunks of round about this size.
 
uinta minLargeBlockSizeBytes
 The smallest block size to be considered large. Must be less than 64K.
 
uinta recycleThresholdStep
 The cumulative total of bytes allocated (excluding large non-collectibles) between cyclic checks of thread heaps to reclaim surplus cache memory.
 
uinta intialSmallBlockGarbageCollectionThresholdBytes
 The initial total of both collectible and non-collectible small block bytes allocated that triggers garbage collection. More...
 
uinta intialLargeBlockGarbageCollectionThresholdBytes
 The initial total of collectible large block bytes allocated that triggers garbage collection. More...
 
uinta garbageCollectionThresholdMultiplier
 Garbage collection threshold recomputation factor (top of fraction) More...
 
uinta garbageCollectionThresholdDivider
 Garbage collection threshold recomputation factor (bottom of fraction) More...
 
void * markingParam
 A parameter passed on unchanged to MDXMarkingHandler::mdxPerformMarking(), and not otherwise used by MDX.
 
MDXMarkingHandlermarkingHandler
 The address of an instance of MDXMarkingHandler to be used for marking. More...
 
void * interceptParam
 A parameter passed on unchanged to MDXInterceptHandler::mdxInterceptFree(), and not otherwise used by MDX.
 
MDXInterceptHandlerinterceptHandler
 The address of an instance of MDXInterceptHandler supplying the intercept free callback. More...
 

Detailed Description

The MDXConfiguration structure gathers together all the configuration information for an MDXPool.

getConfiguration() can be used to fill in the default values. However this method sets markingHandler and interceptHandler to null. To use garbage collection a markingHandler must be supplied, and to use finalization an interceptHandler must be supplied.

Note that throughout this API documentation the type uinta means an unsigned integer of the same size as a void pointer.

Member Data Documentation

uinta MemoryDividerX::MDXConfiguration::flags

The flags set here are applied automatically to every malloc() and free() operation.

The following flags may be set: FLAG_COLLECTIBLE, FLAG_INTERCEPT_FREE, FLAG_FILL_ON_FREE, FLAG_FILL_ON_MALLOC, and FLAG_CHECK_INTEGRITY_EVERY_CALL.

uinta MemoryDividerX::MDXConfiguration::garbageCollectionThresholdDivider

Garbage collection threshold recomputation factor (bottom of fraction)

After each mark and sweep garbage collection cycle a new garbage collection threshold is calculatd using the following formula:

New threshold = (garbageCollectionThresholdMultiplier*(memory still allocated after sweeping))/garbageCollectionThresholdDivider

uinta MemoryDividerX::MDXConfiguration::garbageCollectionThresholdMultiplier

Garbage collection threshold recomputation factor (top of fraction)

After each mark and sweep garbage collection cycle a new garbage collection threshold is calculatd using the following formula:

New threshold = (garbageCollectionThresholdMultiplier*(memory still allocated after sweeping))/garbageCollectionThresholdDivider

MDXInterceptHandler* MemoryDividerX::MDXConfiguration::interceptHandler

The address of an instance of MDXInterceptHandler supplying the intercept free callback.

This can be null if FLAG_INTERCEPT_FREE is never set.

uinta MemoryDividerX::MDXConfiguration::intialLargeBlockGarbageCollectionThresholdBytes

The initial total of collectible large block bytes allocated that triggers garbage collection.

Note this value is obeyed, but aproximately, not exactly;

uinta MemoryDividerX::MDXConfiguration::intialSmallBlockGarbageCollectionThresholdBytes

The initial total of both collectible and non-collectible small block bytes allocated that triggers garbage collection.

Note this value is obeyed, but aproximately, not exactly;

MDXMarkingHandler* MemoryDividerX::MDXConfiguration::markingHandler

The address of an instance of MDXMarkingHandler to be used for marking.

This can be null if FLAG_COLLECTABLE is never set.