mn::memory::basic_allocator< TAllocator, TFilter > Class Template Reference
#include <mn_basic_allocator.hpp>
Collaboration diagram for mn::memory::basic_allocator< TAllocator, TFilter >:
Public Types | |
using | allocator_category = typename TAllocator::allocator_category |
using | is_thread_safe = typename TAllocator::is_thread_safe |
using | filter_type = TFilter |
using | value_type = void |
using | pointer = void * |
using | const_pointer = const void * |
using | difference_type = mn::ptrdiff_t |
using | size_type = size_t |
Public Member Functions | |
basic_allocator () noexcept | |
pointer | allocate (size_t size, size_t alignment) |
malloc() a buffer in a given TAllocator and cheak with the given TFilter is this okay to alloc More... | |
pointer | allocate (size_t size) |
malloc() a buffer in a given TAllocator and cheak with the given TFilter is this okay to alloc More... | |
pointer | allocate (size_t count, size_t size, size_t alignment=0) |
malloc() a buffer in a given TAllocator and cheak with the given TFilter is this okay to alloc More... | |
void | deallocate (pointer address, size_t size, size_t alignment) noexcept |
free() a buffer in a given heap. More... | |
void | deallocate (pointer address, size_t size) noexcept |
free() a buffer in a given heap. More... | |
void | deallocate (pointer address, size_t count, size_t size, size_t alignment) noexcept |
free() a buffer in a given heap. More... | |
template<class Type , typename... Args> | |
Type * | construct (Args &&... args) |
Construct a object from allocated impl. More... | |
template<class Type > | |
void | destroy (Type *address) noexcept |
Deconstruct a object (call deconstructor) and free the memory. More... | |
size_t | get_max_alocator_size () const noexcept |
Get the maximal size to allocate. More... | |
Private Attributes | |
filter_type | m_fFilter |
Detailed Description
template<class TAllocator, class TFilter = basic_allocator_filter>
class mn::memory::basic_allocator< TAllocator, TFilter >
The basic allocater for all allocator impl in this library.
Member Typedef Documentation
◆ allocator_category
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::allocator_category = typename TAllocator::allocator_category |
◆ const_pointer
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::const_pointer = const void* |
◆ difference_type
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::difference_type = mn::ptrdiff_t |
◆ filter_type
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::filter_type = TFilter |
◆ is_thread_safe
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::is_thread_safe = typename TAllocator::is_thread_safe |
◆ pointer
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::pointer = void* |
◆ size_type
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::size_type = size_t |
◆ value_type
template<class TAllocator , class TFilter = basic_allocator_filter>
using mn::memory::basic_allocator< TAllocator, TFilter >::value_type = void |
Constructor & Destructor Documentation
◆ basic_allocator()
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inlinenoexcept |
Member Function Documentation
◆ allocate() [1/3]
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inline |
malloc() a buffer in a given TAllocator and cheak with the given TFilter is this okay to alloc
- Parameters
-
size The size of the Type count The count of the array alignment
- Returns
- Pointer to new memory, or NULL if allocation fails.
◆ allocate() [2/3]
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inline |
malloc() a buffer in a given TAllocator and cheak with the given TFilter is this okay to alloc
- Parameters
-
size Size of desired buffer.
- Returns
- Pointer to new memory, or NULL if allocation fails.
◆ allocate() [3/3]
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inline |
malloc() a buffer in a given TAllocator and cheak with the given TFilter is this okay to alloc
- Parameters
-
size Size of desired buffer. alignment
- Returns
- Pointer to new memory, or NULL if allocation fails.
◆ construct()
template<class TAllocator , class TFilter = basic_allocator_filter>
template<class Type , typename... Args>
|
inline |
Construct a object from allocated impl.
- Template Parameters
-
Type The type of the object.
- Parameters
-
Args The arguments for the constructer of the object.
◆ deallocate() [1/3]
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inlinenoexcept |
free() a buffer in a given heap.
- Parameters
-
address The address to free count The count of the array size The size of the Type alignment
◆ deallocate() [2/3]
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inlinenoexcept |
free() a buffer in a given heap.
- Parameters
-
address The address to free. size The size of the Type
◆ deallocate() [3/3]
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inlinenoexcept |
free() a buffer in a given heap.
- Parameters
-
address The address to free. alignment size The size of the Type
◆ destroy()
template<class TAllocator , class TFilter = basic_allocator_filter>
template<class Type >
|
inlinenoexcept |
Deconstruct a object (call deconstructor) and free the memory.
- Template Parameters
-
Type The type of the object.
- Parameters
-
address The pointer of the object to be deconstruct.
◆ get_max_alocator_size()
template<class TAllocator , class TFilter = basic_allocator_filter>
|
inlinenoexcept |
Get the maximal size to allocate.
- Returns
- The maximal size to allocate.
Member Data Documentation
◆ m_fFilter
template<class TAllocator , class TFilter = basic_allocator_filter>
|
private |
The documentation for this class was generated from the following file: