![]() |
mutable
A Database System for Research and Fast Prototyping
|
This allocator serves allocations using malloc/free. More...
#include <malloc_allocator.hpp>
Public Types | |
using | base_type = allocator< malloc_allocator > |
using | size_type = std::size_t |
Public Member Functions | |
void * | allocate (size_type size, size_type alignment=0) |
Allocate size bytes aligned to alignment . | |
void | deallocate (void *ptr, size_type size) |
Deallocate the allocation at ptr of size size . | |
std::enable_if_t< not std::is_void_v< T >, T * > | allocate () |
Allocate space for a single entity of type T that is aligned according to T s alignment requirement. | |
std::enable_if_t< not std::is_void_v< T >, T * > | allocate (size_type n) |
Allocate space for an array of n entities of type T . | |
std::enable_if_t< not std::is_void_v< T >, void > | deallocate (T *ptr) |
Deallocate the space for an entity of type T at ptr . | |
std::enable_if_t< not std::is_void_v< T >, void > | deallocate (T *arr, size_type n) |
Deallocate the space for an array of n entities of type T . | |
std::enable_if_t< not std::is_array_v< T >, std::unique_ptr< T > > | make_unique () |
std::enable_if_t< std::is_array_v< T >, std::unique_ptr< T > > | make_unique (size_type n) |
void | dispose (std::unique_ptr< T > ptr) |
void | dispose (std::unique_ptr< T > ptr, size_type n) |
This allocator serves allocations using malloc/free.
Definition at line 15 of file malloc_allocator.hpp.
Definition at line 17 of file malloc_allocator.hpp.
|
inherited |
Definition at line 19 of file allocator_base.hpp.
|
inlineinherited |
Allocate space for a single entity of type T
that is aligned according to T
s alignment requirement.
Definition at line 40 of file allocator_base.hpp.
|
inlineinherited |
Allocate space for an array of n
entities of type T
.
The space is aligned according to T
s alignment requirement.
Definition at line 46 of file allocator_base.hpp.
Allocate size
bytes aligned to alignment
.
If alignment
is 0
, the usual alignment of malloc
applies.
Definition at line 23 of file malloc_allocator.hpp.
|
inlineinherited |
Deallocate the space for an array of n
entities of type T
.
Definition at line 56 of file allocator_base.hpp.
|
inlineinherited |
Deallocate the space for an entity of type T
at ptr
.
Definition at line 51 of file allocator_base.hpp.
|
inline |
Deallocate the allocation at ptr
of size size
.
Definition at line 43 of file malloc_allocator.hpp.
|
inlineinherited |
Definition at line 71 of file allocator_base.hpp.
|
inlineinherited |
Definition at line 74 of file allocator_base.hpp.
|
inlineinherited |
Definition at line 64 of file allocator_base.hpp.
|
inlineinherited |
Definition at line 68 of file allocator_base.hpp.