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

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

List of all members.

Public Attributes

uinta flags
 The flags set here are applied automatically to every malloc() and free() operation.
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.
uinta intialLargeBlockGarbageCollectionThresholdBytes
 The initial total of collectible large block bytes allocated that triggers garbage collection.
uinta garbageCollectionThresholdMultiplier
 Garbage collection threshold recomputation factor (top of fraction)
uinta garbageCollectionThresholdDivider
 Garbage collection threshold recomputation factor (bottom of fraction)
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.
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.

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

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.

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

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

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

This can be null if FLAG_INTERCEPT_FREE is never set.

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

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

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;

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

This can be null if FLAG_COLLECTABLE is never set.

 All Classes Namespaces Functions Variables