Embedded Multicore Building Blocks V1.0.0
|
Allocator according to the C++ standard. More...
#include <memory_allocation.h>
Classes | |
struct | rebind |
Rebind allocator to type OtherType. More... | |
Public Types | |
typedef size_t | size_type |
Quantity of elements type. More... | |
typedef ptrdiff_t | difference_type |
Difference between two pointers type. More... | |
typedef Type * | pointer |
Pointer to element type. More... | |
typedef const Type * | const_pointer |
Pointer to constant element type. More... | |
typedef Type & | reference |
Reference to element type. More... | |
typedef const Type & | const_reference |
Reference to constant element type. More... | |
typedef Type | value_type |
Element type. More... | |
Public Member Functions | |
AllocatorCacheAligned () throw () | |
Constructs allocator object. More... | |
AllocatorCacheAligned (const AllocatorCacheAligned &a) throw () | |
Copies allocator object. More... | |
template<typename OtherType > | |
AllocatorCacheAligned (const AllocatorCacheAligned< OtherType > &) throw () | |
Constructs allocator object. More... | |
~AllocatorCacheAligned () throw () | |
Destructs allocator object. More... | |
pointer | allocate (size_type n, const void *=0) |
Allocates but doesn't initialize storage for elements of type Type. More... | |
void | deallocate (pointer p, size_type) |
Deallocates storage of destroyed elements. More... | |
pointer | address (reference x) const |
Gets address of an object. More... | |
const_pointer | address (const_reference x) const |
Gets address of a constant object. More... | |
size_type | max_size () const throw () |
Allocation maximum More... | |
void | construct (pointer p, const value_type &val) |
Initializes elements of allocated storage with specified value. More... | |
void | destroy (pointer p) |
Destroys elements of initialized storage. More... | |
Allocator according to the C++ standard.
Allocates memory cache-aligned.
For memory allocation and deallocation, embb::base::Allocation::AllocateCacheAligned() and embb::base::Allocation::FreeAligned() are used, respectively.
In debug mode, leak checking is active. The function embb::base::Allocation::AllocatedBytes() returns the number of currently allocated bytes.
typedef size_t embb::base::AllocatorCacheAligned< Type >::size_type |
Quantity of elements type.
typedef ptrdiff_t embb::base::AllocatorCacheAligned< Type >::difference_type |
Difference between two pointers type.
typedef Type* embb::base::AllocatorCacheAligned< Type >::pointer |
Pointer to element type.
typedef const Type* embb::base::AllocatorCacheAligned< Type >::const_pointer |
Pointer to constant element type.
typedef Type& embb::base::AllocatorCacheAligned< Type >::reference |
Reference to element type.
typedef const Type& embb::base::AllocatorCacheAligned< Type >::const_reference |
Reference to constant element type.
typedef Type embb::base::AllocatorCacheAligned< Type >::value_type |
Element type.
embb::base::AllocatorCacheAligned< Type >::AllocatorCacheAligned | ( | ) | ||
throw | ( | |||
) |
Constructs allocator object.
embb::base::AllocatorCacheAligned< Type >::AllocatorCacheAligned | ( | const AllocatorCacheAligned< Type > & | a | ) | |
throw | ( | ||||
) |
Copies allocator object.
[in] | a | Other allocator object |
embb::base::AllocatorCacheAligned< Type >::AllocatorCacheAligned | ( | const AllocatorCacheAligned< OtherType > & | ) | ||
throw | ( | ||||
) |
Constructs allocator object.
Allows construction from allocators for different types (rebind)
embb::base::AllocatorCacheAligned< Type >::~AllocatorCacheAligned | ( | ) | ||
throw | ( | |||
) |
Destructs allocator object.
pointer embb::base::AllocatorCacheAligned< Type >::allocate | ( | size_type | n, |
const void * | = 0 |
||
) |
Allocates but doesn't initialize storage for elements of type Type.
[in] | n | Number of elements to allocate |
void embb::base::AllocatorCacheAligned< Type >::deallocate | ( | pointer | p, |
size_type | |||
) |
Deallocates storage of destroyed elements.
[in,out] | p | Pointer to allocated storage |
|
inherited |
Gets address of an object.
x | Reference to object |
|
inherited |
Gets address of a constant object.
x | Reference to constant object |
|
inherited |
Allocation maximum
|
inherited |
Initializes elements of allocated storage with specified value.
p | Pointer to allocated storage |
val | Value |
|
inherited |
Destroys elements of initialized storage.
p | Pointer to allocated storage |