Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
DefaultAllocator Class Reference

#include <elm/alloc/DefaultAllocator.h>

+ Inheritance diagram for DefaultAllocator:

Public Member Functions

voidallocate (t::size size)
 
virtual bool mark (void *data, t::size size)
 
void free (void *block)
 
virtual ~DefaultAllocator ()
 

Static Public Attributes

static DefaultAllocator DEFAULT
 

Detailed Description

Default implementation of a memory allocator just calling new and delete.

Constructor & Destructor Documentation

◆ ~DefaultAllocator()

virtual ~DefaultAllocator ( )
inlinevirtual

Member Function Documentation

◆ allocate()

void * allocate ( t::size  size)

Allocate a memory block of the given size.

Parameters
sizeSize of the block to allocate.
Returns
Allocated block.
Exceptions
BadAllocThrown if there is no more system memory.

Referenced by DefaultAllocatorDelegate::allocate().

◆ free()

void free ( void block)
inline

Free the given block.

Parameters
blockBlock to free.

Referenced by DefaultAllocatorDelegate::free().

◆ mark()

bool mark ( void data,
t::size  size 
)
virtual

Mark a memory block of the given size so that it will not be released by the garbage collector.

Parameters
dataThe data to collect
sizeSize of the block to allocate.
Returns
If the data is already marked

Reimplemented in GroupedGC.

Member Data Documentation

◆ DEFAULT


The documentation for this class was generated from the following files: