nil::crypto3::memory_pool Class Referencefinal

#include <memory_pool.hpp>

+ Collaboration diagram for nil::crypto3::memory_pool:

Public Member Functions

void * allocate (size_t req)
 
bool deallocate (void *p, std::size_t n) BOOST_NOEXCEPT
 
 memory_pool (const memory_pool &)=delete
 
 memory_pool (uint8_t *pool, size_t pool_size, size_t page_size, size_t min_alloc, size_t max_alloc, uint8_t align_bit)
 
memory_pooloperator= (const memory_pool &)=delete
 

Constructor & Destructor Documentation

◆ memory_pool() [1/2]

nil::crypto3::memory_pool::memory_pool ( uint8_t *  pool,
size_t  pool_size,
size_t  page_size,
size_t  min_alloc,
size_t  max_alloc,
uint8_t  align_bit 
)
inline

Initialize a memory pool. The memory is not owned by *this, it must be freed by the caller.

Parameters
poolthe pool
pool_sizesize of pool
page_sizesome nominal page size (does not need to match the system page size)
min_allocationreturn null for allocs for smaller amounts
max_allocationreturn null for allocs of larger amounts
align_bitalign all returned memory to (1<<align_bit) bytes

◆ memory_pool() [2/2]

nil::crypto3::memory_pool::memory_pool ( const memory_pool )
delete

Member Function Documentation

◆ allocate()

void* nil::crypto3::memory_pool::allocate ( size_t  req)
inline

◆ deallocate()

bool nil::crypto3::memory_pool::deallocate ( void *  p,
std::size_t  n 
)
inline

◆ operator=()

memory_pool& nil::crypto3::memory_pool::operator= ( const memory_pool )
delete

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