mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions
m::malloc_allocator Struct Reference

This allocator serves allocations using malloc/free. More...

#include <malloc_allocator.hpp>

Inheritance diagram for m::malloc_allocator:
[legend]
Collaboration diagram for m::malloc_allocator:
[legend]

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 Ts 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)
 

Detailed Description

This allocator serves allocations using malloc/free.

Definition at line 15 of file malloc_allocator.hpp.

Member Typedef Documentation

◆ base_type

Definition at line 17 of file malloc_allocator.hpp.

◆ size_type

using m::allocator< malloc_allocator >::size_type = std::size_t
inherited

Definition at line 19 of file allocator_base.hpp.

Member Function Documentation

◆ allocate() [1/3]

std::enable_if_t< not std::is_void_v< T >, T * > m::allocator< malloc_allocator >::allocate ( )
inlineinherited

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.

◆ allocate() [2/3]

std::enable_if_t< not std::is_void_v< T >, T * > m::allocator< malloc_allocator >::allocate ( size_type  n)
inlineinherited

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.

◆ allocate() [3/3]

void * m::malloc_allocator::allocate ( size_type  size,
size_type  alignment = 0 
)
inline

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.

◆ deallocate() [1/3]

std::enable_if_t< not std::is_void_v< T >, void > m::allocator< malloc_allocator >::deallocate ( T *  arr,
size_type  n 
)
inlineinherited

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

Definition at line 56 of file allocator_base.hpp.

◆ deallocate() [2/3]

std::enable_if_t< not std::is_void_v< T >, void > m::allocator< malloc_allocator >::deallocate ( T *  ptr)
inlineinherited

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

Definition at line 51 of file allocator_base.hpp.

◆ deallocate() [3/3]

void m::malloc_allocator::deallocate ( void *  ptr,
size_type  size 
)
inline

Deallocate the allocation at ptr of size size.

Definition at line 43 of file malloc_allocator.hpp.

◆ dispose() [1/2]

void m::allocator< malloc_allocator >::dispose ( std::unique_ptr< T >  ptr)
inlineinherited

Definition at line 71 of file allocator_base.hpp.

◆ dispose() [2/2]

void m::allocator< malloc_allocator >::dispose ( std::unique_ptr< T >  ptr,
size_type  n 
)
inlineinherited

Definition at line 74 of file allocator_base.hpp.

◆ make_unique() [1/2]

std::enable_if_t< not std::is_array_v< T >, std::unique_ptr< T > > m::allocator< malloc_allocator >::make_unique ( )
inlineinherited

Definition at line 64 of file allocator_base.hpp.

◆ make_unique() [2/2]

std::enable_if_t< std::is_array_v< T >, std::unique_ptr< T > > m::allocator< malloc_allocator >::make_unique ( size_type  n)
inlineinherited

Definition at line 68 of file allocator_base.hpp.


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