Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
This module binds together classes providing different ways to perform memory allocation. This kind of class is usually passed to any container class performing automatic memory allocation. More...
Classes | |
class | GCManager |
class | BlockAllocator< T > |
class | BadAlloc |
class | DefaultAllocator |
class | GroupedGC |
class | ListGC |
class | Temp |
class | class |
class | SimpleGC |
class | StackAllocator |
This module binds together classes providing different ways to perform memory allocation. This kind of class is usually passed to any container class performing automatic memory allocation.
The chosen allocator is usually passed as a template parameter to the collection type and as a parameter to the collection constructor.
An allocator class must implement the concept elm::concept::Allocator.
A collection supporting allocator matches the concept below:
An easy use of custom allocator is the overload of new
and delete
operators of a class to let passing the allocator as a parameter. The code below gives an examples:
Then, you can create and delete the object with the following code: