MySQL 9.0.0
Source Code Documentation
|
A C++ wrapper class to the mem_heap_t routines, so that it can be used as an STL allocator. More...
#include <mem0mem.h>
Classes | |
struct | rebind |
Allocators are required to supply the below template class member which enables the possibility of obtaining a related allocator, parametrized in terms of a different type. More... | |
Public Types | |
typedef T | value_type |
typedef size_t | size_type |
typedef ptrdiff_t | difference_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
Public Member Functions | |
mem_heap_allocator (mem_heap_t *heap) | |
mem_heap_allocator (const mem_heap_allocator &other) | |
template<typename U > | |
mem_heap_allocator (const mem_heap_allocator< U > &other) | |
~mem_heap_allocator () | |
size_type | max_size () const |
pointer | allocate (size_type n, const_pointer hint=nullptr) |
This function returns a pointer to the first element of a newly allocated array large enough to contain n objects of type T; only the memory is allocated, and the objects are not constructed. More... | |
void | deallocate (pointer, size_type) |
pointer | address (reference r) const |
const_pointer | address (const_reference r) const |
void | construct (pointer p, const_reference t) |
void | destroy (pointer p) |
mem_heap_t * | get_mem_heap () const |
Get the underlying memory heap object. More... | |
Private Attributes | |
mem_heap_t * | m_heap |
Friends | |
template<typename U > | |
class | mem_heap_allocator |
A C++ wrapper class to the mem_heap_t routines, so that it can be used as an STL allocator.
typedef const T* mem_heap_allocator< T >::const_pointer |
typedef const T& mem_heap_allocator< T >::const_reference |
typedef ptrdiff_t mem_heap_allocator< T >::difference_type |
typedef T* mem_heap_allocator< T >::pointer |
typedef T& mem_heap_allocator< T >::reference |
typedef size_t mem_heap_allocator< T >::size_type |
typedef T mem_heap_allocator< T >::value_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
This function returns a pointer to the first element of a newly allocated array large enough to contain n objects of type T; only the memory is allocated, and the objects are not constructed.
Moreover, an optional pointer argument (that points to an object already allocated by mem_heap_allocator) can be used as a hint to the implementation about where the new memory should be allocated in order to improve locality.
|
inline |
|
inline |
|
inline |
|
inline |
Get the underlying memory heap object.
|
inline |
|
private |