memory
Typedefs | Classes | Functions
allocator_storage.hpp File Reference

Detailed Description

Class template foonathan::memory::allocator_storage, some policies and resulting typedefs.

Typedefs

using any_reference_storage = reference_storage< any_allocator >
 An alias for the reference_storage specialization using type-erasure.
 
using any_allocator_reference = allocator_storage< any_reference_storage, no_mutex >
 An alias for allocator_storage using the any_reference_storage.
 

Classes

class  allocator_storage< StoragePolicy, Mutex >
 A RawAllocator that stores another allocator. More...
 
struct  any_allocator
 Tag type that enables type-erasure in reference_storage. More...
 
class  direct_storage< RawAllocator >
 A StoragePolicy that stores the allocator directly. More...
 
class  allocator_adapter< RawAllocator >
 An alias template for allocator_storage using the direct_storage policy without a mutex. More...
 
class  thread_safe_allocator< RawAllocator, Mutex >
 An alias template for allocator_storage using the direct_storage policy with a mutex. More...
 
struct  is_shared_allocator< RawAllocator >
 Specifies whether or not a RawAllocator has shared semantics. More...
 
class  reference_storage< RawAllocator >
 A StoragePolicy that stores a reference to an allocator. More...
 
class  reference_storage< any_allocator >
 Specialization of the class template reference_storage that is type-erased. More...
 
class  allocator_reference< RawAllocator >
 An alias template for allocator_storage using the reference_storage policy. More...
 

Functions

template<class Alloc >
void * try_allocate_node (std::true_type, Alloc &alloc, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
void * try_allocate_array (std::true_type, Alloc &alloc, std::size_t count, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
bool try_deallocate_node (std::true_type, Alloc &alloc, void *ptr, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
bool try_deallocate_array (std::true_type, Alloc &alloc, void *ptr, std::size_t count, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
void * try_allocate_node (std::false_type, Alloc &, std::size_t, std::size_t) noexcept
 
template<class Alloc >
void * try_allocate_array (std::false_type, Alloc &, std::size_t, std::size_t, std::size_t) noexcept
 
template<class Alloc >
bool try_deallocate_node (std::false_type, Alloc &, void *, std::size_t, std::size_t) noexcept
 
template<class Alloc >
bool try_deallocate_array (std::false_type, Alloc &, void *, std::size_t, std::size_t, std::size_t) noexcept
 
reference_stateful reference_type (std::true_type stateful, std::false_type shared)
 
reference_stateless reference_type (std::false_type stateful, std::true_type shared)
 
reference_stateless reference_type (std::false_type stateful, std::false_type shared)
 
reference_shared reference_type (std::true_type stateful, std::true_type shared)