Documentation of memory

( foonathan/memory)

allocator_traits< memory_stack< ImplRawAllocator > > Class Template Reference

Detailed Description

template<class ImplRawAllocator>
class foonathan::memory::allocator_traits< memory_stack< ImplRawAllocator > >

Specialization of the allocator_traits for memory_stack classes.

Note
It is not allowed to mix calls through the specialization and through the member functions, i.e. memory_stack::allocate() and this allocate_node().

Typedefs

using allocator_type = memory_stack< ImplRawAllocator >
 
using is_stateful = std::true_type
 

Static Functions

static void * allocate_node (allocator_type &state, std::size_t size, std::size_t alignment)
 
static void * allocate_array (allocator_type &state, std::size_t count, std::size_t size, std::size_t alignment)
 
static std::size_t max_alignment (const allocator_type &) noexcept
 
static void deallocate_node (allocator_type &state, void *, std::size_t size, std::size_t) noexcept
 
static void deallocate_array (allocator_type &state, void *ptr, std::size_t count, std::size_t size, std::size_t alignment) noexcept
 
static std::size_t max_node_size (const allocator_type &state) noexcept
 
static std::size_t max_array_size (const allocator_type &state) noexcept
 

Member Functions

static void* allocate_node ( allocator_type state,
std::size_t  size,
std::size_t  alignment 
)
static
Returns:
The result of memory_stack::allocate().
static void* allocate_array ( allocator_type state,
std::size_t  count,
std::size_t  size,
std::size_t  alignment 
)
static
Returns:
The result of memory_stack::allocate().
static void deallocate_node ( allocator_type state,
void *  ,
std::size_t  size,
std::size_t   
)
staticnoexcept
Effects:
Does nothing besides bookmarking for leak checking, if that is enabled. Actual deallocation can only be done via memory_stack::unwind().
static void deallocate_array ( allocator_type state,
void *  ptr,
std::size_t  count,
std::size_t  size,
std::size_t  alignment 
)
staticnoexcept
Effects:
Does nothing besides bookmarking for leak checking, if that is enabled. Actual deallocation can only be done via memory_stack::unwind().
static std::size_t max_node_size ( const allocator_type state)
staticnoexcept
Returns:
The maximum size which is memory_stack::next_capacity().
static std::size_t max_array_size ( const allocator_type state)
staticnoexcept
Returns:
The maximum size which is memory_stack::next_capacity().
static std::size_t max_alignment ( const allocator_type )
staticnoexcept
Returns:
The maximum possible value since there is no alignment restriction (except indirectly through memory_stack::next_capacity()).