mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions
m::allocator< Actual > Struct Template Reference

#include <allocator_base.hpp>

Public Types

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.
 
template<typename T >
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 Ts alignment requirement.
 
template<typename T >
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.
 
template<typename 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.
 
template<typename T >
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.
 
template<typename T >
std::enable_if_t< not std::is_array_v< T >, std::unique_ptr< T > > make_unique ()
 
template<typename T >
std::enable_if_t< std::is_array_v< T >, std::unique_ptr< T > > make_unique (size_type n)
 
template<typename T >
void dispose (std::unique_ptr< T > ptr)
 
template<typename T >
void dispose (std::unique_ptr< T > ptr, size_type n)
 

Detailed Description

template<typename Actual>
struct m::allocator< Actual >

Definition at line 17 of file allocator_base.hpp.

Member Typedef Documentation

◆ size_type

template<typename Actual >
using m::allocator< Actual >::size_type = std::size_t

Definition at line 19 of file allocator_base.hpp.

Member Function Documentation

◆ allocate() [1/3]

template<typename Actual >
template<typename T >
std::enable_if_t< not std::is_void_v< T >, T * > m::allocator< Actual >::allocate ( )
inline

Allocate space for a single entity of type T that is aligned according to Ts alignment requirement.

Definition at line 40 of file allocator_base.hpp.

References m::allocator< Actual >::allocate(), and m::T().

Referenced by m::allocator< Actual >::allocate(), and m::allocator< Actual >::make_unique().

◆ allocate() [2/3]

template<typename Actual >
template<typename T >
std::enable_if_t< not std::is_void_v< T >, T * > m::allocator< Actual >::allocate ( size_type  n)
inline

Allocate space for an array of n entities of type T.

The space is aligned according to Ts alignment requirement.

Definition at line 46 of file allocator_base.hpp.

References m::allocator< Actual >::allocate(), and m::T().

Referenced by m::allocator< Actual >::allocate().

◆ allocate() [3/3]

template<typename Actual >
void * m::allocator< Actual >::allocate ( size_type  size,
size_type  alignment = 0 
)
inline

Allocate size bytes aligned to alignment.


Definition at line 26 of file allocator_base.hpp.

References m::allocator< Actual >::allocate().

◆ deallocate() [1/3]

template<typename Actual >
template<typename T >
std::enable_if_t< not std::is_void_v< T >, void > m::allocator< Actual >::deallocate ( T arr,
size_type  n 
)
inline

Deallocate the space for an array of n entities of type T.

Definition at line 56 of file allocator_base.hpp.

References m::allocator< Actual >::deallocate(), and m::T().

Referenced by m::allocator< Actual >::deallocate().

◆ deallocate() [2/3]

template<typename Actual >
template<typename T >
std::enable_if_t< not std::is_void_v< T >, void > m::allocator< Actual >::deallocate ( T ptr)
inline

Deallocate the space for an entity of type T at ptr.

Definition at line 51 of file allocator_base.hpp.

References m::allocator< Actual >::deallocate(), and m::T().

Referenced by m::allocator< Actual >::deallocate().

◆ deallocate() [3/3]

template<typename Actual >
void m::allocator< Actual >::deallocate ( void *  ptr,
size_type  size 
)
inline

Deallocate the allocation at ptr of size size.

Definition at line 31 of file allocator_base.hpp.

References m::allocator< Actual >::deallocate().

Referenced by m::allocator< Actual >::deallocate(), and m::memory::Memory::~Memory().

◆ dispose() [1/2]

template<typename Actual >
template<typename T >
void m::allocator< Actual >::dispose ( std::unique_ptr< T ptr)
inline

Definition at line 71 of file allocator_base.hpp.

Referenced by m::PlanTableSmallOrDense::~PlanTableSmallOrDense().

◆ dispose() [2/2]

template<typename Actual >
template<typename T >
void m::allocator< Actual >::dispose ( std::unique_ptr< T ptr,
size_type  n 
)
inline

Definition at line 74 of file allocator_base.hpp.

◆ make_unique() [1/2]

template<typename Actual >
template<typename T >
std::enable_if_t< not std::is_array_v< T >, std::unique_ptr< T > > m::allocator< Actual >::make_unique ( )
inline

Definition at line 64 of file allocator_base.hpp.

◆ make_unique() [2/2]

template<typename Actual >
template<typename T >
std::enable_if_t< std::is_array_v< T >, std::unique_ptr< T > > m::allocator< Actual >::make_unique ( size_type  n)
inline

Definition at line 68 of file allocator_base.hpp.

References m::allocator< Actual >::allocate().


The documentation for this struct was generated from the following file: