Orocos Real-Time Toolkit
2.5.0
|
A simple local allocator which keeps a small pool which you can grow manually with grow(). More...
#include <rtt/os/oro_allocator.hpp>
Public Types | |
typedef Alloc::value_type | value_type |
typedef Alloc::pointer | pointer |
typedef Alloc::const_pointer | const_pointer |
typedef Alloc::reference | reference |
typedef Alloc::const_reference | const_reference |
typedef Alloc::size_type | size_type |
typedef Alloc::difference_type | difference_type |
Public Member Functions | |
pointer | address (reference x) const |
const_pointer | address (const_reference x) const |
pointer | allocate (size_type n, const_pointer hint=0) |
void | deallocate (pointer p, size_type n) |
size_type | max_size () const |
void | construct (pointer p, const value_type &x) |
void | destroy (pointer p) |
void | grow (size_type n, const_pointer hint=0) |
Grow local pool with room for at least n additional items. | |
void | shrink (size_type n) |
Shrink local pool with n items. | |
local_allocator (const local_allocator &) | |
template<class U , class A > | |
local_allocator (const local_allocator< U, A > &) |
A simple local allocator which keeps a small pool which you can grow manually with grow().
It delegates allocation to the Alloc for each allocation request, also if the pool is empty. The pool works on a per-type basis globally (static !). The pool is thus _not_ per-object. A per-object allocator is not allowed by the standard. The pool is deallocated upon global destruction.
T | the type to allocate memory for |
Alloc | the allocator to delegate allocation to. |
Definition at line 64 of file oro_allocator.hpp.