Class MemoryManager

Class Documentation

class MemoryManager

Public Types

enum class Error

Values:

enumerator NO_MEMPOOLS_AVAILABLE
enumerator NO_MEMPOOL_FOR_REQUESTED_CHUNK_SIZE
enumerator MEMPOOL_OUT_OF_CHUNKS

Public Functions

MemoryManager() noexcept = default
MemoryManager(const MemoryManager&) = delete
MemoryManager(MemoryManager&&) = delete
MemoryManager &operator=(const MemoryManager&) = delete
MemoryManager &operator=(MemoryManager&&) = delete
~MemoryManager() noexcept = default
void configureMemoryManager(const MePooConfig &mePooConfig, posix::Allocator &managementAllocator, posix::Allocator &chunkMemoryAllocator) noexcept
cxx::expected<SharedChunk, Error> getChunk(const ChunkSettings &chunkSettings) noexcept

Obtains a chunk from the mempools.

Parameters:

chunkSettings[in] for the requested chunk

Returns:

a SharedChunk if successful, otherwise a MemoryManager::Error

uint32_t getNumberOfMemPools() const noexcept
MemPoolInfo getMemPoolInfo(const uint32_t index) const noexcept

Public Static Functions

static uint64_t requiredChunkMemorySize(const MePooConfig &mePooConfig) noexcept
static uint64_t requiredManagementMemorySize(const MePooConfig &mePooConfig) noexcept
static uint64_t requiredFullMemorySize(const MePooConfig &mePooConfig) noexcept