memory
Classes | Functions
segregator.hpp File Reference

Detailed Description

Class template foonathan::memory::segregator and related classes.

Classes

class  threshold_segregatable< RawAllocator >
 A Segregatable that allocates until a maximum size. More...
 
class  null_allocator
 A composable RawAllocator that will always fail. More...
 
class  binary_segregator< Segregatable, RawAllocator >
 A RawAllocator that either uses the Segregatable or the other RawAllocator. More...
 
class  segregator< Allocators >
 Creates multiple nested binary_segregator. More...
 
struct  segregator_size< Segregator >
 The number of Segregatable a segregator has. More...
 

Functions

template<class RawAllocator >
threshold_segregatable< typename std::decay< RawAllocator >::type > threshold (std::size_t max_size, RawAllocator &&alloc)
 
template<class Segregator , class Fallback = null_allocator>
auto make_segregator (Segregator &&seg, Fallback &&f=null_allocator{}) -> binary_segregator< typename std::decay< Segregator >::type, typename std::decay< Fallback >::type >
 
template<class Segregator , typename... Rest>
auto make_segregator (Segregator &&seg, Rest &&... rest) -> binary_segregator< typename std::decay< Segregator >::type, decltype(make_segregator(std::forward< Rest >(rest)...))>
 
template<std::size_t I, class Segregator , class Fallback >
auto get_segregatable_allocator (const binary_segregator< Segregator, Fallback > &s) -> const segregatable_allocator_type< I, binary_segregator< Segregator, Fallback > >
 
template<class Segregator , class Fallback >
auto get_fallback_allocator (const binary_segregator< Segregator, Fallback > &s) -> const fallback_allocator_type< binary_segregator< Segregator, Fallback > > &