CXXR (C++ R)
|
STL-compatible allocator front-ending CXXR::MemoryBank. More...
#include <Allocator.hpp>
Public Member Functions | |
pointer | address (reference value) const |
const_pointer | address (const_reference value) const |
Allocator (const Allocator &) throw () | |
template<class U > | |
Allocator (const Allocator< U > &) throw () | |
size_type | max_size () const throw () |
pointer | allocate (size_type num, const void *=0) |
void | construct (pointer p, const T &value) |
void | destroy (pointer p) |
void | deallocate (pointer p, size_type num) |
STL-compatible allocator front-ending CXXR::MemoryBank.
This templated class enables container classes within the C++ standard library to allocate their memory via CXXR::MemoryBank. However, its calls to MemoryBank are configured so that they do not give rise to garbage collections: this is to avoid any reentrant calls to the code for C++ standard library containers.
The code below is adapted from an example in the book "The C++ Standard Library - A Tutorial and Reference" by Nicolai M. Josuttis, Addison-Wesley, 1999. Also see Item 10 of Meyers' 'Effective STL' for the arcana of STL allocators.