SyTen
syten::EternalMalloc Namespace Reference

Implementation namespace for le_malloc() and le_free() More...

Classes

struct  MtxWrapper
 To serve and protect. More...
 
struct  Region
 Struct representing one region of the eternal malloc pool. More...
 
struct  RegionsInitialiser
 https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Nifty_Counter has a detailed explanation. More...
 

Functions

template<typename T , typename U >
constexpr T next_multiple (T const current, U const alignment)
 Casts current to the type of alignment and adds the difference to the next value at which U(current) % alignment is zero; i.e. if alignment is 64, it returns the smallest value greater than current which is divisible by 64. More...
 

Variables

static std::mutexmtx = reinterpret_cast<std::mutex&>(mutex_buffer)
 
static std::size_t mtx_counter
 
static struct syten::EternalMalloc::MtxWrapper mtxWrapper
 
static std::aligned_storage< sizeof(std::mutex), alignof(std::mutex)>::type mutex_buffer
 
static constexpr std::size_t region_default_size {4ULL * 1024ULL * 1024ULL}
 Default region size (unless a single allocation wouldn't fit. More...
 
static std::vector< Region > & regions = reinterpret_cast<std::vector<Region>&>(regions_buffer)
 regions is a reference to space allocated at regions_buffer, holds a vector of allocated regions. More...
 
static std::aligned_storage< sizeof(std::vector< Region >), alignof(std::vector< Region >)>::type regions_buffer
 Space for the regions object (cf. More...
 
static std::size_t regionsCounter
 cf. More...
 
static struct syten::EternalMalloc::RegionsInitialiser regionsInitialiser
 See EternalMalloc::RegionsInitialiser. More...
 

Detailed Description

Implementation namespace for le_malloc() and le_free()