Memory Divider X
MDX = malloc() + free() + Garbage Collection
 All Classes Namespaces Functions Variables
Public Member Functions
MemoryDividerX::MDXMarkingHandler Class Reference

Implement this interface to provide a marking callback. More...

List of all members.

Public Member Functions

virtual void mdxPerformMarking (MDXPool *pool, void *markingParam)=0
 The marking callback itself.
virtual ~MDXMarkingHandler ()
 A virtual destructor, present only to avoid compiler warnings.

Detailed Description

Implement this interface to provide a marking callback.

Set a marking callback by setting MDXConfiguration::markingHandler to point to an instance of MDXMarkingHandler.

Member Function Documentation

virtual void MemoryDividerX::MDXMarkingHandler::mdxPerformMarking ( MDXPool pool,
void *  markingParam 
) [pure virtual]

The marking callback itself.

Use MDXPool::mark(void *chunk) and MDXPool::mark(uinta count, void **chunks) to actually mark the wanted blocks. Use MDXPool::isMarked(void *chunk), MDXPool::getFlags(void *chunk) or MDXPool::getFlags(uinta count, MDXFlags *flags) to determine whether or not a block's already been marked.

The marking callback must not allocate or free memory. Also it must not change the settings of any block's flags, except for FLAG_MARKED, which is set when a block is marked.

poolThe address of the MDXPool object managing the memory to be marked.
markingParamThe value of MDXConfiguration::markingParam from the pool's MDXConfiguration structure.
 All Classes Namespaces Functions Variables