Memory Divider X
MDX = malloc() + free() + Garbage Collection
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
MemoryDividerX::MDXMarkingHandler Class Referenceabstract

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

Public Member Functions

virtual void mdxPerformMarking (MDXPool *pool, void *markingParam)=0
 The marking callback itself. More...
 
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. MDXPool::mark(void *chunk) also returns wether or not the block was already marked before it was called. 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.

Parameters
poolThe address of the MDXPool object managing the memory to be marked.
markingParamThe value of MDXConfiguration::markingParam from the pool's MDXConfiguration structure.