memory
Typedefs | Classes | Functions
memory_arena.hpp File Reference

Detailed Description

Class foonathan::memory::memory_arena and related functionality regarding BlockAllocators.

Typedefs

template<class RawAlloc >
using default_block_wrapper = growing_block_allocator< RawAlloc >
 
template<class BlockOrRawAllocator , template< typename... > class BlockAllocator = detail::default_block_wrapper>
using make_block_allocator_t = implementation_defined
 Takes either a BlockAllocator or a RawAllocator.
 

Classes

struct  memory_block
 A memory block. More...
 
struct  is_block_allocator< T >
 Traits that check whether a type models concept BlockAllocator. More...
 
class  memory_arena< BlockAllocator, Cached >
 A memory arena that manages huge memory blocks for a higher-level allocator. More...
 
class  growing_block_allocator< RawAllocator, Num, Den >
 A BlockAllocator that uses a given RawAllocator for allocating the blocks. More...
 
class  fixed_block_allocator< RawAllocator >
 A BlockAllocator that allows only one block allocation. More...
 

Variables

constexpr bool cached_arena
 
constexpr bool uncached_arena
 

Functions

template<class BlockAllocator >
std::true_type is_block_allocator_impl (int,,,)
 
template<typename T >
std::false_type is_block_allocator_impl (short)
 
template<template< class... > class Wrapper, class BlockAllocator , typename... Args>
BlockAllocator make_block_allocator (std::true_type, std::size_t block_size, Args &&... args)
 
template<template< class... > class Wrapper, class RawAlloc >
auto make_block_allocator (std::false_type, std::size_t block_size, RawAlloc alloc=RawAlloc()) -> Wrapper< RawAlloc >
 
template<class BlockOrRawAllocator , typename... Args>
make_block_allocator_t< BlockOrRawAllocator > make_block_allocator (std::size_t block_size, Args &&... args)
 
template<template< class... > class BlockAllocator, class BlockOrRawAllocator , typename... Args>
make_block_allocator_t< BlockOrRawAllocator, BlockAllocator > make_block_allocator (std::size_t block_size, Args &&... args)
 
constexpr std::size_t operator""_KiB (unsigned long long value) noexcept
 Syntax sugar to express sizes with unit prefixes.
 
constexpr std::size_t operator""_KB (unsigned long long value) noexcept
 Syntax sugar to express sizes with unit prefixes.
 
constexpr std::size_t operator""_MiB (unsigned long long value) noexcept
 Syntax sugar to express sizes with unit prefixes.
 
constexpr std::size_t operator""_MB (unsigned long long value) noexcept
 Syntax sugar to express sizes with unit prefixes.
 
constexpr std::size_t operator""_GiB (unsigned long long value) noexcept
 Syntax sugar to express sizes with unit prefixes.
 
constexpr std::size_t operator""_GB (unsigned long long value) noexcept
 Syntax sugar to express sizes with unit prefixes.