17 #ifndef IOX_POSH_MEPOO_MEMORY_MANAGER_HPP
18 #define IOX_POSH_MEPOO_MEMORY_MANAGER_HPP
20 #include "iceoryx_posh/iceoryx_posh_types.hpp"
21 #include "iceoryx_posh/internal/mepoo/mem_pool.hpp"
22 #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp"
23 #include "iceoryx_posh/mepoo/chunk_settings.hpp"
24 #include "iceoryx_utils/cxx/helplets.hpp"
25 #include "iceoryx_utils/cxx/vector.hpp"
32 #include "iceoryx_utils/platform/platform_correction.hpp"
46 using MaxChunkPayloadSize_t = cxx::range<uint32_t, 1, std::numeric_limits<uint32_t>::max() -
sizeof(
ChunkHeader)>;
56 void configureMemoryManager(
const MePooConfig& mePooConfig,
57 posix::Allocator& managementAllocator,
58 posix::Allocator& chunkMemoryAllocator) noexcept;
62 uint32_t getNumberOfMemPools()
const noexcept;
64 MemPoolInfo getMemPoolInfo(
const uint32_t index)
const noexcept;
66 static uint64_t requiredChunkMemorySize(
const MePooConfig& mePooConfig) noexcept;
67 static uint64_t requiredManagementMemorySize(
const MePooConfig& mePooConfig) noexcept;
68 static uint64_t requiredFullMemorySize(
const MePooConfig& mePooConfig) noexcept;
71 static uint32_t sizeWithChunkHeaderStruct(
const MaxChunkPayloadSize_t size) noexcept;
73 void printMemPoolVector(log::LogStream& log)
const noexcept;
74 void addMemPool(posix::Allocator& managementAllocator,
75 posix::Allocator& chunkMemoryAllocator,
76 const cxx::greater_or_equal<uint32_t, MemPool::CHUNK_MEMORY_ALIGNMENT> chunkPayloadSize,
77 const cxx::greater_or_equal<uint32_t, 1> numberOfChunks) noexcept;
78 void generateChunkManagementPool(posix::Allocator& managementAllocator) noexcept;
81 bool m_denyAddMemPool{
false};
82 uint32_t m_totalNumberOfChunks{0};
84 cxx::vector<MemPool, MAX_NUMBER_OF_MEMPOOLS> m_memPoolVector;
85 cxx::vector<MemPool, 1> m_chunkManagementPool;
Definition: chunk_settings.hpp:30
Definition: memory_manager.hpp:45
WARNING: SharedChunk is not thread safe! Don't share SharedChunk objects between threads!...
Definition: shared_chunk.hpp:35
Definition: service_description.hpp:29
Definition: mepoo_config.hpp:33
Definition: mem_pool.hpp:35