Flex  0.17.9
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
gs::ArenaAllocator Class Reference

#include <allocators.h>

Public Member Functions

 ArenaAllocator (MemoryStrategy strategy, const std::string &prefix)
 
 ~ArenaAllocator ()
 
void reserve (size_t cap)
 
void * allocate (size_t size)
 
size_t allocated_memory () const
 

Private Member Functions

void * allocate_batch (size_t size)
 

Private Attributes

MemoryStrategy strategy_
 
std::string prefix_
 
std::vector< mmap_array< char > * > mmap_buffers_
 
void * cur_buffer_
 
size_t cur_loc_
 
size_t cur_size_
 
size_t allocated_memory_
 
size_t allocated_batches_
 

Static Private Attributes

static constexpr size_t batch_size = 16 * 1024 * 1024
 

Constructor & Destructor Documentation

◆ ArenaAllocator()

gs::ArenaAllocator::ArenaAllocator ( MemoryStrategy  strategy,
const std::string &  prefix 
)
inline

◆ ~ArenaAllocator()

gs::ArenaAllocator::~ArenaAllocator ( )
inline

Member Function Documentation

◆ allocate()

void* gs::ArenaAllocator::allocate ( size_t  size)
inline

◆ allocate_batch()

void* gs::ArenaAllocator::allocate_batch ( size_t  size)
inlineprivate

◆ allocated_memory()

size_t gs::ArenaAllocator::allocated_memory ( ) const
inline

◆ reserve()

void gs::ArenaAllocator::reserve ( size_t  cap)
inline

Member Data Documentation

◆ allocated_batches_

size_t gs::ArenaAllocator::allocated_batches_
private

◆ allocated_memory_

size_t gs::ArenaAllocator::allocated_memory_
private

◆ batch_size

constexpr size_t gs::ArenaAllocator::batch_size = 16 * 1024 * 1024
staticconstexprprivate

◆ cur_buffer_

void* gs::ArenaAllocator::cur_buffer_
private

◆ cur_loc_

size_t gs::ArenaAllocator::cur_loc_
private

◆ cur_size_

size_t gs::ArenaAllocator::cur_size_
private

◆ mmap_buffers_

std::vector<mmap_array<char>*> gs::ArenaAllocator::mmap_buffers_
private

◆ prefix_

std::string gs::ArenaAllocator::prefix_
private

◆ strategy_

MemoryStrategy gs::ArenaAllocator::strategy_
private

The documentation for this class was generated from the following file: