From e50d0630026581fc4c24940e100bab0dcf807c8a Mon Sep 17 00:00:00 2001 From: Marika Lehmann Date: Tue, 29 Nov 2022 13:17:52 +0100 Subject: [PATCH] iox-#1732 Move and rename shared memory object allocator Signed-off-by: Marika Lehmann --- .../test/moduletests/test_client.cpp | 4 +- .../test/moduletests/test_listener.cpp | 2 +- .../moduletests/test_notification_info.cpp | 2 +- .../test/moduletests/test_publisher.cpp | 2 +- .../test/moduletests/test_server.cpp | 4 +- .../test/moduletests/test_subscriber.cpp | 2 +- iceoryx_hoofs/CMakeLists.txt | 2 +- .../internal/cxx/storable_function.inl | 1 + .../posix_wrapper/shared_memory_object.hpp | 8 ++-- .../include/iox/bump_allocator.hpp} | 26 ++++++----- .../source/bump_allocator.cpp} | 13 ++---- .../posix_wrapper/shared_memory_object.cpp | 6 +-- ...tor.cpp => test_memory_bump_allocator.cpp} | 46 +++++++++---------- .../test_posix_shared_memory_object.cpp | 4 +- .../iceoryx_posh/internal/mepoo/mem_pool.hpp | 6 +-- .../internal/mepoo/memory_manager.hpp | 11 +++-- .../internal/mepoo/mepoo_segment.hpp | 4 +- .../internal/mepoo/mepoo_segment.inl | 4 +- .../internal/mepoo/segment_manager.hpp | 6 +-- .../internal/mepoo/segment_manager.inl | 2 +- .../internal/mepoo/typed_mem_pool.hpp | 5 +- .../internal/mepoo/typed_mem_pool.inl | 4 +- iceoryx_posh/source/mepoo/mem_pool.cpp | 4 +- iceoryx_posh/source/mepoo/memory_manager.cpp | 10 ++-- .../source/roudi/memory/memory_provider.cpp | 4 +- .../mempool_collection_memory_block.cpp | 4 +- .../mempool_segment_manager_memory_block.cpp | 4 +- .../test_popo_chunk_building_blocks.cpp | 2 +- .../test_popo_port_user_building_blocks.cpp | 2 +- .../moduletests/test_mepoo_memory_manager.cpp | 6 +-- .../test/moduletests/test_mepoo_mempool.cpp | 8 ++-- .../test/moduletests/test_mepoo_segment.cpp | 8 ++-- .../test_mepoo_segment_management.cpp | 6 +-- .../moduletests/test_mepoo_shared_chunk.cpp | 4 +- .../moduletests/test_mepoo_shared_pointer.cpp | 4 +- .../test_mepoo_shm_safe_unmanaged_chunk.cpp | 4 +- .../moduletests/test_mepoo_typed_mempool.cpp | 4 +- .../test_popo_chunk_distributor.cpp | 2 +- .../moduletests/test_popo_chunk_queue.cpp | 4 +- .../moduletests/test_popo_chunk_receiver.cpp | 4 +- .../moduletests/test_popo_chunk_sender.cpp | 4 +- .../moduletests/test_popo_client_port.cpp | 2 +- .../moduletests/test_popo_publisher_port.cpp | 4 +- .../test_popo_server_port_common.hpp | 2 +- .../moduletests/test_popo_subscriber_port.cpp | 1 - .../moduletests/test_popo_used_chunk_list.cpp | 4 +- 46 files changed, 133 insertions(+), 132 deletions(-) rename iceoryx_hoofs/{include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp => memory/include/iox/bump_allocator.hpp} (72%) rename iceoryx_hoofs/{source/posix_wrapper/shared_memory_object/allocator.cpp => memory/source/bump_allocator.cpp} (87%) rename iceoryx_hoofs/test/moduletests/{test_posix_allocator.cpp => test_memory_bump_allocator.cpp} (77%) diff --git a/iceoryx_binding_c/test/moduletests/test_client.cpp b/iceoryx_binding_c/test/moduletests/test_client.cpp index 8a1351890d5..3ab6de4b69c 100644 --- a/iceoryx_binding_c/test/moduletests/test_client.cpp +++ b/iceoryx_binding_c/test/moduletests/test_client.cpp @@ -103,10 +103,10 @@ class iox_client_test : public Test static constexpr uint64_t MANAGEMENT_MEMORY_SIZE = 1024 * 1024; char managementMemory[MANAGEMENT_MEMORY_SIZE]; - iox::posix::Allocator mgmtAllocator{managementMemory, MANAGEMENT_MEMORY_SIZE}; + iox::BumpAllocator mgmtAllocator{managementMemory, MANAGEMENT_MEMORY_SIZE}; static constexpr uint64_t DATA_MEMORY_SIZE = 1024 * 1024; char dataMemory[DATA_MEMORY_SIZE]; - iox::posix::Allocator dataAllocator{dataMemory, DATA_MEMORY_SIZE}; + iox::BumpAllocator dataAllocator{dataMemory, DATA_MEMORY_SIZE}; iox::mepoo::MemoryManager memoryManager; iox::mepoo::MePooConfig memoryConfig; diff --git a/iceoryx_binding_c/test/moduletests/test_listener.cpp b/iceoryx_binding_c/test/moduletests/test_listener.cpp index 4516113bc8e..d495b32a363 100644 --- a/iceoryx_binding_c/test/moduletests/test_listener.cpp +++ b/iceoryx_binding_c/test/moduletests/test_listener.cpp @@ -198,7 +198,7 @@ class iox_listener_test : public Test static constexpr uint32_t CHUNK_SIZE = 128U; static constexpr uint64_t MEMORY_SIZE = 1024U * 1024U * 100U; uint8_t m_memory[MEMORY_SIZE]; - Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; MePooConfig m_mempoolconf; MemoryManager m_memoryManager; diff --git a/iceoryx_binding_c/test/moduletests/test_notification_info.cpp b/iceoryx_binding_c/test/moduletests/test_notification_info.cpp index 2f22917aa58..02ac647d19e 100644 --- a/iceoryx_binding_c/test/moduletests/test_notification_info.cpp +++ b/iceoryx_binding_c/test/moduletests/test_notification_info.cpp @@ -102,7 +102,7 @@ class iox_notification_info_test : public Test static constexpr uint32_t CHUNK_SIZE = 128U; static constexpr size_t MEMORY_SIZE = 1024 * 1024 * 100; uint8_t m_memory[MEMORY_SIZE]; - Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; MePooConfig m_mempoolconf; MemoryManager m_memoryManager; SubscriberOptions m_subscriberOptions{MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY, 0U}; diff --git a/iceoryx_binding_c/test/moduletests/test_publisher.cpp b/iceoryx_binding_c/test/moduletests/test_publisher.cpp index 1f79b806e10..7e95439526f 100644 --- a/iceoryx_binding_c/test/moduletests/test_publisher.cpp +++ b/iceoryx_binding_c/test/moduletests/test_publisher.cpp @@ -106,7 +106,7 @@ class iox_pub_test : public Test ChunkQueueData_t m_chunkQueueData{iox::popo::QueueFullPolicy::DISCARD_OLDEST_DATA, iox::cxx::VariantQueueTypes::SoFi_SingleProducerSingleConsumer}; - Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; MePooConfig m_mempoolconf; MemoryManager m_memoryManager; diff --git a/iceoryx_binding_c/test/moduletests/test_server.cpp b/iceoryx_binding_c/test/moduletests/test_server.cpp index 9e6b33aaf0b..dce7830a4b5 100644 --- a/iceoryx_binding_c/test/moduletests/test_server.cpp +++ b/iceoryx_binding_c/test/moduletests/test_server.cpp @@ -96,10 +96,10 @@ class iox_server_test : public Test static constexpr uint64_t MANAGEMENT_MEMORY_SIZE = 1024 * 1024; char managementMemory[MANAGEMENT_MEMORY_SIZE]; - iox::posix::Allocator mgmtAllocator{managementMemory, MANAGEMENT_MEMORY_SIZE}; + iox::BumpAllocator mgmtAllocator{managementMemory, MANAGEMENT_MEMORY_SIZE}; static constexpr uint64_t DATA_MEMORY_SIZE = 1024 * 1024; char dataMemory[DATA_MEMORY_SIZE]; - iox::posix::Allocator dataAllocator{dataMemory, DATA_MEMORY_SIZE}; + iox::BumpAllocator dataAllocator{dataMemory, DATA_MEMORY_SIZE}; iox::mepoo::MemoryManager memoryManager; iox::mepoo::MePooConfig memoryConfig; diff --git a/iceoryx_binding_c/test/moduletests/test_subscriber.cpp b/iceoryx_binding_c/test/moduletests/test_subscriber.cpp index a68539f3046..e3b95c3fe63 100644 --- a/iceoryx_binding_c/test/moduletests/test_subscriber.cpp +++ b/iceoryx_binding_c/test/moduletests/test_subscriber.cpp @@ -102,7 +102,7 @@ class iox_sub_test : public Test static constexpr uint32_t NUM_CHUNKS_IN_POOL = MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY + 2U; static constexpr uint32_t CHUNK_SIZE = 128U; - Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; MePooConfig m_mempoolconf; MemoryManager m_memoryManager; diff --git a/iceoryx_hoofs/CMakeLists.txt b/iceoryx_hoofs/CMakeLists.txt index 552498f9da1..9d32f822de3 100644 --- a/iceoryx_hoofs/CMakeLists.txt +++ b/iceoryx_hoofs/CMakeLists.txt @@ -80,7 +80,6 @@ iox_add_library( source/posix_wrapper/scheduler.cpp source/posix_wrapper/semaphore_interface.cpp source/posix_wrapper/shared_memory_object.cpp - source/posix_wrapper/shared_memory_object/allocator.cpp source/posix_wrapper/shared_memory_object/memory_map.cpp source/posix_wrapper/shared_memory_object/shared_memory.cpp source/posix_wrapper/signal_handler.cpp @@ -91,6 +90,7 @@ iox_add_library( source/posix_wrapper/unix_domain_socket.cpp source/memory/relative_pointer_data.cpp source/units/duration.cpp + memory/source/bump_allocator.cpp ) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/iceoryx_hoofs_deployment.hpp.in" diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/storable_function.inl b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/storable_function.inl index 694a3e40588..ba9ec4a230d 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/storable_function.inl +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/storable_function.inl @@ -169,6 +169,7 @@ inline void swap(storable_function& f, storable_function void* allocate(byte_t* startAddress) { + // static_assert: startAddress + size < Capacity uint64_t alignedPosition = cxx::align(reinterpret_cast(startAddress), alignof(T)); return reinterpret_cast(alignedPosition); } diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp index d677045ce84..1784a387bb5 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp +++ b/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp @@ -19,10 +19,10 @@ #include "iceoryx_hoofs/cxx/filesystem.hpp" #include "iceoryx_hoofs/design_pattern/builder.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/memory_map.hpp" #include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/shared_memory.hpp" #include "iceoryx_platform/stat.hpp" +#include "iox/bump_allocator.hpp" #include "iox/optional.hpp" #include @@ -70,7 +70,7 @@ class SharedMemoryObject void finalizeAllocation() noexcept; /// @brief Returns the reference to the underlying allocator - Allocator& getAllocator() noexcept; + BumpAllocator& getBumpAllocator() noexcept; /// @brief Returns start- or base-address of the shared memory. const void* getBaseAddress() const noexcept; @@ -94,7 +94,7 @@ class SharedMemoryObject private: SharedMemoryObject(SharedMemory&& sharedMemory, MemoryMap&& memoryMap, - Allocator&& allocator, + BumpAllocator&& allocator, const uint64_t memorySizeInBytes) noexcept; private: @@ -102,7 +102,7 @@ class SharedMemoryObject SharedMemory m_sharedMemory; MemoryMap m_memoryMap; - Allocator m_allocator; + BumpAllocator m_allocator; }; class SharedMemoryObjectBuilder diff --git a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp b/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp similarity index 72% rename from iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp rename to iceoryx_hoofs/memory/include/iox/bump_allocator.hpp index 0fcf2d37e57..6ed809e7746 100644 --- a/iceoryx_hoofs/include/iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp +++ b/iceoryx_hoofs/memory/include/iox/bump_allocator.hpp @@ -14,8 +14,8 @@ // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 -#ifndef IOX_HOOFS_POSIX_WRAPPER_SHARED_MEMORY_OBJECT_ALLOCATOR_HPP -#define IOX_HOOFS_POSIX_WRAPPER_SHARED_MEMORY_OBJECT_ALLOCATOR_HPP +#ifndef IOX_HOOFS_MEMORY_BUMP_ALLOCATOR_HPP +#define IOX_HOOFS_MEMORY_BUMP_ALLOCATOR_HPP #include namespace iox @@ -23,24 +23,26 @@ namespace iox namespace posix { class SharedMemoryObject; +} -class Allocator +class BumpAllocator { using byte_t = uint8_t; public: + // remove: static constexpr uint64_t MEMORY_ALIGNMENT = 8U; /// @brief A bump allocator for the memory provided in the ctor arguments /// @param[in] startAddress of the memory this allocator manages /// @param[in] length of the memory this allocator manages - Allocator(void* const startAddress, const uint64_t length) noexcept; + BumpAllocator(void* const startAddress, const uint64_t length) noexcept; - Allocator(const Allocator&) = delete; - Allocator(Allocator&&) noexcept = default; - Allocator& operator=(const Allocator&) noexcept = delete; - Allocator& operator=(Allocator&&) noexcept = default; - ~Allocator() noexcept = default; + BumpAllocator(const BumpAllocator&) = delete; + BumpAllocator(BumpAllocator&&) noexcept = default; + BumpAllocator& operator=(const BumpAllocator&) noexcept = delete; + BumpAllocator& operator=(BumpAllocator&&) noexcept = default; + ~BumpAllocator() noexcept = default; /// @brief allocates on the memory supplied with the ctor /// @param[in] size of the memory to allocate @@ -49,7 +51,8 @@ class Allocator void* allocate(const uint64_t size, const uint64_t alignment) noexcept; protected: - friend class SharedMemoryObject; + friend class posix::SharedMemoryObject; + // make free function; destructive move? void finalizeAllocation() noexcept; private: @@ -58,7 +61,6 @@ class Allocator uint64_t m_currentPosition = 0U; bool m_allocationFinalized = false; }; -} // namespace posix } // namespace iox -#endif // IOX_HOOFS_POSIX_WRAPPER_SHARED_MEMORY_OBJECT_ALLOCATOR_HPP +#endif // IOX_HOOFS_POSIX_MEMORY_BUMP_ALLOCATOR_HPP diff --git a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/allocator.cpp b/iceoryx_hoofs/memory/source/bump_allocator.cpp similarity index 87% rename from iceoryx_hoofs/source/posix_wrapper/shared_memory_object/allocator.cpp rename to iceoryx_hoofs/memory/source/bump_allocator.cpp index 77b8f951c60..3b2b63d4392 100644 --- a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object/allocator.cpp +++ b/iceoryx_hoofs/memory/source/bump_allocator.cpp @@ -15,7 +15,7 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" +#include "iox/bump_allocator.hpp" #include "iceoryx_hoofs/cxx/helplets.hpp" #include "iceoryx_hoofs/log/logging.hpp" #include "iceoryx_platform/platform_correction.hpp" @@ -24,10 +24,8 @@ namespace iox { -namespace posix -{ -constexpr uint64_t Allocator::MEMORY_ALIGNMENT; -Allocator::Allocator(void* const startAddress, const uint64_t length) noexcept +constexpr uint64_t BumpAllocator::MEMORY_ALIGNMENT; +BumpAllocator::BumpAllocator(void* const startAddress, const uint64_t length) noexcept : m_startAddress(static_cast(startAddress)) , m_length(length) { @@ -35,7 +33,7 @@ Allocator::Allocator(void* const startAddress, const uint64_t length) noexcept // NOLINTJUSTIFICATION allocation interface requires size and alignment as integral types // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) -void* Allocator::allocate(const uint64_t size, const uint64_t alignment) noexcept +void* BumpAllocator::allocate(const uint64_t size, const uint64_t alignment) noexcept { cxx::Expects(size > 0); @@ -70,10 +68,9 @@ void* Allocator::allocate(const uint64_t size, const uint64_t alignment) noexcep return static_cast(l_returnValue); } -void Allocator::finalizeAllocation() noexcept +void BumpAllocator::finalizeAllocation() noexcept { m_allocationFinalized = true; } -} // namespace posix } // namespace iox diff --git a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp index e6864bc5c9f..ca0ae877522 100644 --- a/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp +++ b/iceoryx_hoofs/source/posix_wrapper/shared_memory_object.cpp @@ -109,7 +109,7 @@ expected SharedMemoryObjectBuilder: return error(SharedMemoryObjectError::MAPPING_SHARED_MEMORY_FAILED); } - Allocator allocator(memoryMap->getBaseAddress(), m_memorySizeInBytes); + BumpAllocator allocator(memoryMap->getBaseAddress(), m_memorySizeInBytes); if (sharedMemory->hasOwnership()) { @@ -157,7 +157,7 @@ expected SharedMemoryObjectBuilder: SharedMemoryObject::SharedMemoryObject(SharedMemory&& sharedMemory, MemoryMap&& memoryMap, - Allocator&& allocator, + BumpAllocator&& allocator, const uint64_t memorySizeInBytes) noexcept : m_memorySizeInBytes(memorySizeInBytes) , m_sharedMemory(std::move(sharedMemory)) @@ -176,7 +176,7 @@ void SharedMemoryObject::finalizeAllocation() noexcept m_allocator.finalizeAllocation(); } -Allocator& SharedMemoryObject::getAllocator() noexcept +BumpAllocator& SharedMemoryObject::getBumpAllocator() noexcept { return m_allocator; } diff --git a/iceoryx_hoofs/test/moduletests/test_posix_allocator.cpp b/iceoryx_hoofs/test/moduletests/test_memory_bump_allocator.cpp similarity index 77% rename from iceoryx_hoofs/test/moduletests/test_posix_allocator.cpp rename to iceoryx_hoofs/test/moduletests/test_memory_bump_allocator.cpp index 9acb561cbca..8834870ce72 100644 --- a/iceoryx_hoofs/test/moduletests/test_posix_allocator.cpp +++ b/iceoryx_hoofs/test/moduletests/test_memory_bump_allocator.cpp @@ -15,15 +15,14 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" -#include "iceoryx_hoofs/log/logging.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" namespace { using namespace testing; -class Allocator_Test : public Test +class BumpAllocator_Test : public Test { public: void SetUp() override @@ -38,34 +37,34 @@ class Allocator_Test : public Test free(memory); } - static constexpr uint64_t MEMORY_ALIGNMENT{iox::posix::Allocator::MEMORY_ALIGNMENT}; + static constexpr uint64_t MEMORY_ALIGNMENT{8}; void* memory{nullptr}; size_t memorySize = 10016; }; -TEST_F(Allocator_Test, allocateOneSmallElement) +TEST_F(BumpAllocator_Test, allocateOneSmallElement) { ::testing::Test::RecordProperty("TEST_ID", "f689e95c-5743-4370-93f0-8a23b909c75a"); - iox::posix::Allocator sut(memory, memorySize); + iox::BumpAllocator sut(memory, memorySize); int* bla = static_cast(sut.allocate(sizeof(int), MEMORY_ALIGNMENT)); *bla = 123; EXPECT_THAT(*bla, Eq(123)); } -TEST_F(Allocator_Test, allocateEverythingWithSingleElement) +TEST_F(BumpAllocator_Test, allocateEverythingWithSingleElement) { ::testing::Test::RecordProperty("TEST_ID", "f2e1085b-08fe-4b08-b022-0385b5a53fca"); - iox::posix::Allocator sut(memory, memorySize); + iox::BumpAllocator sut(memory, memorySize); int* bla = static_cast(sut.allocate(memorySize, 1)); *bla = 123; EXPECT_THAT(*bla, Eq(123)); } -TEST_F(Allocator_Test, allocateEverythingWithMultipleElements) +TEST_F(BumpAllocator_Test, allocateEverythingWithMultipleElements) { ::testing::Test::RecordProperty("TEST_ID", "21d0fa61-54f9-41a0-8e53-e3448784497b"); - iox::posix::Allocator sut(memory, memorySize); + iox::BumpAllocator sut(memory, memorySize); for (size_t i = 0; i < memorySize; i += 32) { auto* bla = static_cast(sut.allocate(32, 1)); @@ -74,10 +73,11 @@ TEST_F(Allocator_Test, allocateEverythingWithMultipleElements) } } -TEST_F(Allocator_Test, allocateTooMuchSingleElement) +TEST_F(BumpAllocator_Test, allocateTooMuchSingleElement) { ::testing::Test::RecordProperty("TEST_ID", "9deed5c0-19d8-4469-a5c3-f185d4d881f1"); - iox::posix::Allocator sut(memory, memorySize); + iox::BumpAllocator sut(memory, memorySize); + std::set_terminate([]() { std::cout << "", std::abort(); }); // @todo iox-#1613 remove EXPECT_DEATH // NOLINTBEGIN(hicpp-avoid-goto, cppcoreguidelines-avoid-goto, cert-err33-c, cppcoreguidelines-pro-type-vararg, // hiccpp-vararg) @@ -86,10 +86,10 @@ TEST_F(Allocator_Test, allocateTooMuchSingleElement) // hiccpp-vararg) } -TEST_F(Allocator_Test, allocateTooMuchMultipleElement) +TEST_F(BumpAllocator_Test, allocateTooMuchMultipleElement) { ::testing::Test::RecordProperty("TEST_ID", "435151e8-cc34-41ce-8115-5c179716a60a"); - iox::posix::Allocator sut(memory, memorySize); + iox::BumpAllocator sut(memory, memorySize); for (size_t i = 0; i < memorySize; i += 32) { sut.allocate(32, 1); @@ -103,19 +103,19 @@ TEST_F(Allocator_Test, allocateTooMuchMultipleElement) // hiccpp-vararg) } -TEST_F(Allocator_Test, allocateAndAlignment) +TEST_F(BumpAllocator_Test, allocateAndAlignment) { ::testing::Test::RecordProperty("TEST_ID", "4252ddcc-05d4-499f-ad7c-30bffb420e08"); - iox::posix::Allocator sut(memory, memorySize); + iox::BumpAllocator sut(memory, memorySize); auto* bla = static_cast(sut.allocate(5, MEMORY_ALIGNMENT)); auto* bla2 = static_cast(sut.allocate(5, MEMORY_ALIGNMENT)); EXPECT_THAT(bla2 - bla, Eq(8U)); } -TEST_F(Allocator_Test, allocateElementOfSizeZero) +TEST_F(BumpAllocator_Test, allocateElementOfSizeZero) { ::testing::Test::RecordProperty("TEST_ID", "17caa50c-94bf-4a1d-a1ec-dfda563caa0b"); - iox::posix::Allocator sut(memory, memorySize); + iox::BumpAllocator sut(memory, memorySize); // @todo iox-#1613 remove EXPECT_DEATH // NOLINTBEGIN(hicpp-avoid-goto, cppcoreguidelines-avoid-goto, cert-err33-c, cppcoreguidelines-pro-type-vararg, @@ -125,18 +125,18 @@ TEST_F(Allocator_Test, allocateElementOfSizeZero) // hiccpp-vararg) } -TEST_F(Allocator_Test, allocateAfterFinalizeAllocation) +TEST_F(BumpAllocator_Test, allocateAfterFinalizeAllocation) { ::testing::Test::RecordProperty("TEST_ID", "323fc1af-481f-4732-b7d3-fa32da389cef"); - class AllocatorAccess : iox::posix::Allocator + class AllocatorAccess : iox::BumpAllocator { public: AllocatorAccess(void* const f_startAddress, const uint64_t f_length) - : iox::posix::Allocator(f_startAddress, f_length) + : iox::BumpAllocator(f_startAddress, f_length) { } - using iox::posix::Allocator::allocate; - using iox::posix::Allocator::finalizeAllocation; + using iox::BumpAllocator::allocate; + using iox::BumpAllocator::finalizeAllocation; }; AllocatorAccess sut(memory, memorySize); sut.allocate(5, MEMORY_ALIGNMENT); diff --git a/iceoryx_hoofs/test/moduletests/test_posix_shared_memory_object.cpp b/iceoryx_hoofs/test/moduletests/test_posix_shared_memory_object.cpp index 5e6e5d138f3..f036e14a882 100644 --- a/iceoryx_hoofs/test/moduletests/test_posix_shared_memory_object.cpp +++ b/iceoryx_hoofs/test/moduletests/test_posix_shared_memory_object.cpp @@ -141,7 +141,7 @@ TEST_F(SharedMemoryObject_Test, AllocateTooMuchMemoryInSharedMemoryWithOneChunk) ASSERT_THAT(sut.has_error(), Eq(false)); - PerformDeathTest([&] { sut->allocate(cxx::align(memorySize, posix::Allocator::MEMORY_ALIGNMENT) + 1, 1); }); + PerformDeathTest([&] { sut->allocate(cxx::align(memorySize, BumpAllocator::MEMORY_ALIGNMENT) + 1, 1); }); } TEST_F(SharedMemoryObject_Test, AllocateTooMuchSharedMemoryWithMultipleChunks) @@ -158,7 +158,7 @@ TEST_F(SharedMemoryObject_Test, AllocateTooMuchSharedMemoryWithMultipleChunks) ASSERT_THAT(sut.has_error(), Eq(false)); - for (uint64_t i = 0; i < cxx::align(memorySize, posix::Allocator::MEMORY_ALIGNMENT); ++i) + for (uint64_t i = 0; i < cxx::align(memorySize, BumpAllocator::MEMORY_ALIGNMENT); ++i) { void* test = sut->allocate(1, 1); ASSERT_THAT(test, Ne(nullptr)); diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mem_pool.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mem_pool.hpp index a1643d887d2..15ab719d248 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mem_pool.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mem_pool.hpp @@ -19,9 +19,9 @@ #include "iceoryx_hoofs/cxx/helplets.hpp" #include "iceoryx_hoofs/internal/concurrent/loffli.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/memory/relative_pointer.hpp" #include "iceoryx_posh/mepoo/chunk_header.hpp" +#include "iox/bump_allocator.hpp" #include #include @@ -52,8 +52,8 @@ class MemPool MemPool(const cxx::greater_or_equal chunkSize, const cxx::greater_or_equal numberOfChunks, - posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator) noexcept; + BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator) noexcept; MemPool(const MemPool&) = delete; MemPool(MemPool&&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp index f80b2195ba9..21804ffc415 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/memory_manager.hpp @@ -23,6 +23,7 @@ #include "iceoryx_posh/internal/mepoo/mem_pool.hpp" #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/mepoo/chunk_settings.hpp" +#include "iox/bump_allocator.hpp" #include "iox/expected.hpp" #include @@ -62,8 +63,8 @@ class MemoryManager ~MemoryManager() noexcept = default; void configureMemoryManager(const MePooConfig& mePooConfig, - posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator) noexcept; + BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator) noexcept; /// @brief Obtains a chunk from the mempools /// @param[in] chunkSettings for the requested chunk @@ -82,11 +83,11 @@ class MemoryManager static uint32_t sizeWithChunkHeaderStruct(const MaxChunkPayloadSize_t size) noexcept; void printMemPoolVector(log::LogStream& log) const noexcept; - void addMemPool(posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator, + void addMemPool(BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator, const cxx::greater_or_equal chunkPayloadSize, const cxx::greater_or_equal numberOfChunks) noexcept; - void generateChunkManagementPool(posix::Allocator& managementAllocator) noexcept; + void generateChunkManagementPool(BumpAllocator& managementAllocator) noexcept; private: bool m_denyAddMemPool{false}; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp index 4c1007a193c..3d40920de3e 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.hpp @@ -19,11 +19,11 @@ #include "iceoryx_hoofs/internal/posix_wrapper/access_control.hpp" #include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/mepoo/memory_info.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iox/bump_allocator.hpp" namespace iox { @@ -34,7 +34,7 @@ class MePooSegment { public: MePooSegment(const MePooConfig& mempoolConfig, - posix::Allocator& managementAllocator, + BumpAllocator& managementAllocator, const posix::PosixGroup& readerGroup, const posix::PosixGroup& writerGroup, const iox::mepoo::MemoryInfo& memoryInfo = iox::mepoo::MemoryInfo()) noexcept; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl index f73abc9bdc0..c90d23db05a 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/mepoo_segment.inl @@ -34,7 +34,7 @@ constexpr cxx::perms MePooSegment::SE template inline MePooSegment::MePooSegment( const MePooConfig& mempoolConfig, - posix::Allocator& managementAllocator, + BumpAllocator& managementAllocator, const posix::PosixGroup& readerGroup, const posix::PosixGroup& writerGroup, const iox::mepoo::MemoryInfo& memoryInfo) noexcept @@ -59,7 +59,7 @@ inline MePooSegment::MePooSegment( errorHandler(PoshError::MEPOO__SEGMENT_COULD_NOT_APPLY_POSIX_RIGHTS_TO_SHARED_MEMORY); } - m_memoryManager.configureMemoryManager(mempoolConfig, managementAllocator, m_sharedMemoryObject.getAllocator()); + m_memoryManager.configureMemoryManager(mempoolConfig, managementAllocator, m_sharedMemoryObject.getBumpAllocator()); m_sharedMemoryObject.finalizeAllocation(); } diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.hpp index da2a97264a0..018fda694d6 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.hpp @@ -18,13 +18,13 @@ #define IOX_POSH_MEPOO_SEGMENT_MANAGER_HPP #include "iceoryx_hoofs/cxx/vector.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp" #include "iceoryx_posh/iceoryx_posh_config.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/mepoo/mepoo_segment.hpp" #include "iceoryx_posh/mepoo/segment_config.hpp" +#include "iox/bump_allocator.hpp" #include "iox/optional.hpp" #include "iox/string.hpp" @@ -42,7 +42,7 @@ template > class SegmentManager { public: - SegmentManager(const SegmentConfig& segmentConfig, posix::Allocator* managementAllocator) noexcept; + SegmentManager(const SegmentConfig& segmentConfig, BumpAllocator* managementAllocator) noexcept; ~SegmentManager() noexcept = default; SegmentManager(const SegmentManager& rhs) = delete; @@ -100,7 +100,7 @@ class SegmentManager template friend class roudi::MemPoolIntrospection; - posix::Allocator* m_managementAllocator; + BumpAllocator* m_managementAllocator; cxx::vector m_segmentContainer; bool m_createInterfaceEnabled{true}; }; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.inl b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.inl index c9c11c2d8b7..2caeb470844 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/segment_manager.inl @@ -28,7 +28,7 @@ namespace mepoo { template inline SegmentManager::SegmentManager(const SegmentConfig& segmentConfig, - posix::Allocator* managementAllocator) noexcept + BumpAllocator* managementAllocator) noexcept : m_managementAllocator(managementAllocator) { cxx::Expects(segmentConfig.m_sharedMemorySegments.capacity() <= m_segmentContainer.capacity()); diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.hpp b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.hpp index 4245f6fe0ea..8b3a67001d4 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.hpp @@ -24,6 +24,7 @@ #include "iceoryx_posh/internal/mepoo/mem_pool.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/mepoo/shared_pointer.hpp" +#include "iox/bump_allocator.hpp" #include "iox/expected.hpp" #include "iox/optional.hpp" #include "iox/variant.hpp" @@ -45,8 +46,8 @@ class TypedMemPool { public: TypedMemPool(const cxx::greater_or_equal numberOfChunks, - posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator) noexcept; + BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator) noexcept; TypedMemPool(const TypedMemPool&) = delete; TypedMemPool(TypedMemPool&&) = delete; diff --git a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.inl b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.inl index 75abe0b32c0..ff42fc926e6 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.inl +++ b/iceoryx_posh/include/iceoryx_posh/internal/mepoo/typed_mem_pool.inl @@ -28,8 +28,8 @@ namespace mepoo { template inline TypedMemPool::TypedMemPool(const cxx::greater_or_equal numberOfChunks, - posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator) noexcept + BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator) noexcept : m_memPool(static_cast(requiredChunkSize()), numberOfChunks, managementAllocator, chunkMemoryAllocator) , m_chunkManagementPool(sizeof(ChunkManagement), numberOfChunks, managementAllocator, managementAllocator) { diff --git a/iceoryx_posh/source/mepoo/mem_pool.cpp b/iceoryx_posh/source/mepoo/mem_pool.cpp index 7721f76cdc1..17382f5c74e 100644 --- a/iceoryx_posh/source/mepoo/mem_pool.cpp +++ b/iceoryx_posh/source/mepoo/mem_pool.cpp @@ -41,8 +41,8 @@ constexpr uint64_t MemPool::CHUNK_MEMORY_ALIGNMENT; MemPool::MemPool(const cxx::greater_or_equal chunkSize, const cxx::greater_or_equal numberOfChunks, - posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator) noexcept + BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator) noexcept : m_chunkSize(chunkSize) , m_numberOfChunks(numberOfChunks) , m_minFree(numberOfChunks) diff --git a/iceoryx_posh/source/mepoo/memory_manager.cpp b/iceoryx_posh/source/mepoo/memory_manager.cpp index 0af20d910c2..a4f4c4847c5 100644 --- a/iceoryx_posh/source/mepoo/memory_manager.cpp +++ b/iceoryx_posh/source/mepoo/memory_manager.cpp @@ -39,8 +39,8 @@ void MemoryManager::printMemPoolVector(log::LogStream& log) const noexcept } } -void MemoryManager::addMemPool(posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator, +void MemoryManager::addMemPool(BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator, const cxx::greater_or_equal chunkPayloadSize, const cxx::greater_or_equal numberOfChunks) noexcept { @@ -67,7 +67,7 @@ void MemoryManager::addMemPool(posix::Allocator& managementAllocator, m_totalNumberOfChunks += numberOfChunks; } -void MemoryManager::generateChunkManagementPool(posix::Allocator& managementAllocator) noexcept +void MemoryManager::generateChunkManagementPool(BumpAllocator& managementAllocator) noexcept { m_denyAddMemPool = true; uint32_t chunkSize = sizeof(ChunkManagement); @@ -133,8 +133,8 @@ uint64_t MemoryManager::requiredFullMemorySize(const MePooConfig& mePooConfig) n } void MemoryManager::configureMemoryManager(const MePooConfig& mePooConfig, - posix::Allocator& managementAllocator, - posix::Allocator& chunkMemoryAllocator) noexcept + BumpAllocator& managementAllocator, + BumpAllocator& chunkMemoryAllocator) noexcept { for (auto entry : mePooConfig.m_mempoolConfig) { diff --git a/iceoryx_posh/source/roudi/memory/memory_provider.cpp b/iceoryx_posh/source/roudi/memory/memory_provider.cpp index 98e2152b2fe..580c25aad23 100644 --- a/iceoryx_posh/source/roudi/memory/memory_provider.cpp +++ b/iceoryx_posh/source/roudi/memory/memory_provider.cpp @@ -17,11 +17,11 @@ #include "iceoryx_posh/roudi/memory/memory_provider.hpp" #include "iceoryx_hoofs/cxx/helplets.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/memory/relative_pointer.hpp" #include "iceoryx_posh/error_handling/error_handling.hpp" #include "iceoryx_posh/internal/log/posh_logging.hpp" #include "iceoryx_posh/roudi/memory/memory_block.hpp" +#include "iox/bump_allocator.hpp" namespace iox { @@ -94,7 +94,7 @@ expected MemoryProvider::create() noexcept LogDebug() << "Registered memory segment " << iox::log::hex(m_memory) << " with size " << m_size << " to id " << m_segmentId; - iox::posix::Allocator allocator(m_memory, m_size); + iox::BumpAllocator allocator(m_memory, m_size); for (auto* memoryBlock : m_memoryBlocks) { diff --git a/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp b/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp index 5369c36607f..0615fdf2a93 100644 --- a/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp +++ b/iceoryx_posh/source/roudi/memory/mempool_collection_memory_block.cpp @@ -20,7 +20,7 @@ #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_hoofs/cxx/algorithm.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" +#include "iox/bump_allocator.hpp" namespace iox { @@ -51,7 +51,7 @@ uint64_t MemPoolCollectionMemoryBlock::alignment() const noexcept void MemPoolCollectionMemoryBlock::onMemoryAvailable(cxx::not_null memory) noexcept { - posix::Allocator allocator(memory, size()); + BumpAllocator allocator(memory, size()); auto memoryManager = allocator.allocate(sizeof(mepoo::MemoryManager), alignof(mepoo::MemoryManager)); m_memoryManager = new (memoryManager) mepoo::MemoryManager; diff --git a/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp b/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp index 063b4b0075e..63a6c1ce853 100644 --- a/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp +++ b/iceoryx_posh/source/roudi/memory/mempool_segment_manager_memory_block.cpp @@ -17,7 +17,7 @@ #include "iceoryx_posh/internal/roudi/memory/mempool_segment_manager_memory_block.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" +#include "iox/bump_allocator.hpp" namespace iox { @@ -48,7 +48,7 @@ uint64_t MemPoolSegmentManagerMemoryBlock::alignment() const noexcept void MemPoolSegmentManagerMemoryBlock::onMemoryAvailable(cxx::not_null memory) noexcept { - posix::Allocator allocator(memory, size()); + BumpAllocator allocator(memory, size()); auto segmentManager = allocator.allocate(sizeof(mepoo::SegmentManager<>), alignof(mepoo::SegmentManager<>)); m_segmentManager = new (segmentManager) mepoo::SegmentManager<>(m_segmentConfig, &allocator); } diff --git a/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp index f486abb4ad2..4806f8a6c34 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_chunk_building_blocks.cpp @@ -204,7 +204,7 @@ class ChunkBuildingBlocks_IntegrationTest : public Test std::atomic m_forwarderRun{true}; // Memory objects - Allocator m_memoryAllocator{g_memory, MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{g_memory, MEMORY_SIZE}; MePooConfig m_mempoolConfig; MemoryManager m_memoryManager; diff --git a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp index 9e8bd832c28..0cb91582d74 100644 --- a/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp +++ b/iceoryx_posh/test/integrationtests/test_popo_port_user_building_blocks.cpp @@ -108,7 +108,7 @@ class PortUser_IntegrationTest : public Test std::atomic m_publisherRunFinished{0U}; // Memory objects - Allocator m_memoryAllocator{g_memory, MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{g_memory, MEMORY_SIZE}; MePooConfig m_mempoolConfig; MemoryManager m_memoryManager; diff --git a/iceoryx_posh/test/moduletests/test_mepoo_memory_manager.cpp b/iceoryx_posh/test/moduletests/test_mepoo_memory_manager.cpp index ce098f17e57..4a79a4f220f 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_memory_manager.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_memory_manager.cpp @@ -15,10 +15,10 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/testing/mocks/logger_mock.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" namespace @@ -35,7 +35,7 @@ class MemoryManager_test : public Test void SetUp() override { rawMemory = malloc(rawMemorySize); - allocator = new iox::posix::Allocator(rawMemory, rawMemorySize); + allocator = new iox::BumpAllocator(rawMemory, rawMemorySize); sut = new iox::mepoo::MemoryManager(); }; void TearDown() override @@ -66,7 +66,7 @@ class MemoryManager_test : public Test static constexpr uint32_t CHUNK_SIZE_128{128}; static constexpr uint32_t CHUNK_SIZE_256{256U}; - iox::posix::Allocator* allocator; + iox::BumpAllocator* allocator; void* rawMemory; size_t rawMemorySize = 1000000; diff --git a/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp b/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp index 0dc4b3c6dcb..9fb28596d73 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_mempool.cpp @@ -15,8 +15,8 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/internal/mepoo/mem_pool.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" namespace @@ -45,7 +45,7 @@ class MemPool_test : public Test alignas(MemPool::CHUNK_MEMORY_ALIGNMENT) uint8_t m_rawMemory[NUMBER_OF_CHUNKS * CHUNK_SIZE + LOFFLI_MEMORY_REQUIREMENT]; - iox::posix::Allocator allocator; + iox::BumpAllocator allocator; MemPool sut; }; @@ -54,7 +54,7 @@ TEST_F(MemPool_test, MempoolCtorInitialisesTheObjectWithValuesPassedToTheCtor) { ::testing::Test::RecordProperty("TEST_ID", "b15b0da5-74e0-481b-87b6-53888b8a9890"); char memory[8192]; - iox::posix::Allocator allocator{memory, 8192U}; + iox::BumpAllocator allocator{memory, 8192U}; iox::mepoo::MemPool sut(CHUNK_SIZE, NUMBER_OF_CHUNKS, allocator, allocator); @@ -68,7 +68,7 @@ TEST_F(MemPool_test, MempoolCtorWhenChunkSizeIsNotAMultipleOfAlignmentReturnErro { ::testing::Test::RecordProperty("TEST_ID", "ee06090a-8e3c-4df2-b74e-ed50e29b84e6"); char memory[8192U]; - iox::posix::Allocator allocator{memory, 100U}; + iox::BumpAllocator allocator{memory, 100U}; constexpr uint32_t NOT_ALLIGNED_CHUNKED_SIZE{33U}; iox::optional detectedError; diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp index 3e4d04ada64..6678b0244e9 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp @@ -16,7 +16,6 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp" #include "iceoryx_hoofs/testing/test_definitions.hpp" #include "iceoryx_platform/fcntl.hpp" @@ -24,6 +23,7 @@ #include "iceoryx_platform/types.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/mepoo/mepoo_segment.hpp" +#include "iox/bump_allocator.hpp" #include "iox/expected.hpp" #include "test.hpp" @@ -71,7 +71,7 @@ class MePooSegment_test : public Test remove("/tmp/roudi_segment_test"); } - iox::posix::Allocator& getAllocator() + iox::BumpAllocator& getBumpAllocator() { return *allocator; } @@ -104,7 +104,7 @@ class MePooSegment_test : public Test void* m_baseAddressHint{nullptr}; static constexpr int MEM_SIZE = 100000; char memory[MEM_SIZE]; - std::shared_ptr allocator{new iox::posix::Allocator(memory, MEM_SIZE)}; + std::shared_ptr allocator{new iox::BumpAllocator(memory, MEM_SIZE)}; int filehandle; static createFct createVerificator; }; @@ -145,7 +145,7 @@ class MePooSegment_test : public Test static constexpr uint64_t RawMemorySize{20000}; uint8_t m_rawMemory[RawMemorySize]; - iox::posix::Allocator m_managementAllocator{iox::posix::Allocator(m_rawMemory, RawMemorySize)}; + iox::BumpAllocator m_managementAllocator{iox::BumpAllocator(m_rawMemory, RawMemorySize)}; MePooConfig mepooConfig = setupMepooConfig(); diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp index c70d542a5e8..0da426f2db4 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment_management.cpp @@ -16,7 +16,6 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/posix_wrapper/posix_access_rights.hpp" #include "iceoryx_hoofs/testing/test_definitions.hpp" #include "iceoryx_posh/error_handling/error_handling.hpp" @@ -24,6 +23,7 @@ #include "iceoryx_posh/internal/mepoo/segment_manager.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" #include "iceoryx_posh/mepoo/segment_config.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" @@ -37,7 +37,7 @@ class MePooSegmentMock { public: MePooSegmentMock(const MePooConfig& mempoolConfig IOX_MAYBE_UNUSED, - Allocator& managementAllocator IOX_MAYBE_UNUSED, + iox::BumpAllocator& managementAllocator IOX_MAYBE_UNUSED, const PosixGroup& readerGroup IOX_MAYBE_UNUSED, const PosixGroup& writerGroup IOX_MAYBE_UNUSED, const MemoryInfo& memoryInfo IOX_MAYBE_UNUSED) noexcept @@ -92,7 +92,7 @@ class SegmentManager_test : public Test static constexpr size_t MEM_SIZE{20000}; char memory[MEM_SIZE]; - iox::posix::Allocator allocator{memory, MEM_SIZE}; + iox::BumpAllocator allocator{memory, MEM_SIZE}; MePooConfig mepooConfig = getMempoolConfig(); SegmentConfig segmentConfig = getSegmentConfig(); diff --git a/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp b/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp index 91ad99b06a5..3d02c69589a 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_shared_chunk.cpp @@ -15,10 +15,10 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/mepoo/chunk_header.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" namespace @@ -58,7 +58,7 @@ class SharedChunk_Test : public Test static constexpr uint32_t USER_PAYLOAD_SIZE{64U}; char memory[4096U]; - iox::posix::Allocator allocator{memory, 4096U}; + iox::BumpAllocator allocator{memory, 4096U}; MemPool mempool{sizeof(ChunkHeader) + USER_PAYLOAD_SIZE, NUMBER_OF_CHUNKS, allocator, allocator}; MemPool chunkMgmtPool{CHUNK_SIZE, NUMBER_OF_CHUNKS, allocator, allocator}; void* memoryChunk{mempool.getChunk()}; diff --git a/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp b/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp index c9fe9177f15..7a76fcb799d 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_shared_pointer.cpp @@ -15,10 +15,10 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/mepoo/shared_pointer.hpp" #include "iceoryx_posh/mepoo/chunk_header.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" namespace @@ -139,7 +139,7 @@ class SharedPointer_Test : public Test static constexpr uint32_t USER_PAYLOAD_SIZE{64U}; char memory[4096U]; - iox::posix::Allocator allocator{memory, 4096U}; + iox::BumpAllocator allocator{memory, 4096U}; MemPool mempool{sizeof(ChunkHeader) + USER_PAYLOAD_SIZE, 10U, allocator, allocator}; MemPool chunkMgmtPool{64U, 10U, allocator, allocator}; diff --git a/iceoryx_posh/test/moduletests/test_mepoo_shm_safe_unmanaged_chunk.cpp b/iceoryx_posh/test/moduletests/test_mepoo_shm_safe_unmanaged_chunk.cpp index af1ceb67da4..03071ca397f 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_shm_safe_unmanaged_chunk.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_shm_safe_unmanaged_chunk.cpp @@ -16,11 +16,11 @@ #include "iceoryx_posh/internal/mepoo/shm_safe_unmanaged_chunk.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/mepoo/chunk_header.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" @@ -60,7 +60,7 @@ class ShmSafeUnmanagedChunk_test : public Test static constexpr uint32_t NUM_CHUNKS_IN_POOL = 100; static constexpr uint32_t CHUNK_SIZE = 128; - iox::posix::Allocator m_memoryAllocator{m_memory.get(), MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{m_memory.get(), MEMORY_SIZE}; }; TEST_F(ShmSafeUnmanagedChunk_test, DefaultConstructedResultsInLogicalNullptr) diff --git a/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp b/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp index c6a18dca94a..82596f12abe 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_typed_mempool.cpp @@ -17,7 +17,7 @@ #include "iceoryx_posh/internal/mepoo/typed_mem_pool.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" @@ -57,7 +57,7 @@ class TypedMemPool_test : public Test void TearDown(){}; alignas(MemPool::CHUNK_MEMORY_ALIGNMENT) uint8_t m_rawMemory[NumberOfChunks * ChunkSize + LoFFLiMemoryRequirement]; - iox::posix::Allocator allocator; + iox::BumpAllocator allocator; TypedMemPool sut; }; diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp index 5727d88862f..8887434a576 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp @@ -75,7 +75,7 @@ class ChunkDistributor_test : public Test static constexpr uint32_t MAX_NUMBER_QUEUES = 128U; static constexpr uint32_t MEMPOOL_CHUNK_COUNT{iox::MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY * 2}; std::unique_ptr memory{new uint8_t[MEMORY_SIZE]}; - iox::posix::Allocator allocator{memory.get(), MEMORY_SIZE}; + iox::BumpAllocator allocator{memory.get(), MEMORY_SIZE}; MemPool mempool{sizeof(ChunkHeader) + USER_PAYLOAD_SIZE, MEMPOOL_CHUNK_COUNT, allocator, allocator}; MemPool chunkMgmtPool{128U, MEMPOOL_CHUNK_COUNT, allocator, allocator}; diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp index 27dc1cab871..a980d24e6ba 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_queue.cpp @@ -15,7 +15,6 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/internal/mepoo/typed_mem_pool.hpp" @@ -25,6 +24,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/condition_listener.hpp" #include "iceoryx_posh/internal/popo/building_blocks/locking_policy.hpp" #include "iceoryx_posh/mepoo/chunk_header.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" @@ -63,7 +63,7 @@ class ChunkQueue_testBase static constexpr size_t MEGABYTE = 1U << 20U; static constexpr size_t MEMORY_SIZE = 4U * MEGABYTE; std::unique_ptr memory{new char[MEMORY_SIZE]}; - iox::posix::Allocator allocator{memory.get(), MEMORY_SIZE}; + iox::BumpAllocator allocator{memory.get(), MEMORY_SIZE}; MemPool mempool{ sizeof(ChunkHeader) + USER_PAYLOAD_SIZE, 2U * iox::MAX_SUBSCRIBER_QUEUE_CAPACITY, allocator, allocator}; MemPool chunkMgmtPool{128U, 2U * iox::MAX_SUBSCRIBER_QUEUE_CAPACITY, allocator, allocator}; diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp index edc5a64d49e..af272320a7b 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp @@ -15,7 +15,6 @@ // // SPDX-License-Identifier: Apache-2.0 -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/testing/mocks/logger_mock.hpp" #include "iceoryx_posh/error_handling/error_handling.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" @@ -26,6 +25,7 @@ #include "iceoryx_posh/internal/popo/building_blocks/locking_policy.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" #include "iceoryx_posh/testing/mocks/chunk_mock.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" #include @@ -79,7 +79,7 @@ class ChunkReceiver_test : public Test iox::MAX_CHUNKS_HELD_PER_SUBSCRIBER_SIMULTANEOUSLY + iox::MAX_SUBSCRIBER_QUEUE_CAPACITY; static constexpr uint32_t CHUNK_SIZE = 128; - iox::posix::Allocator m_memoryAllocator{m_memory.get(), MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{m_memory.get(), MEMORY_SIZE}; iox::mepoo::MePooConfig m_mempoolconf; iox::mepoo::MemoryManager m_memoryManager; diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp index 98ab427b70b..2a78d1ad99c 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp @@ -16,7 +16,6 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_hoofs/cxx/scope_guard.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_hoofs/testing/mocks/logger_mock.hpp" #include "iceoryx_posh/error_handling/error_handling.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" @@ -32,6 +31,7 @@ #include "iceoryx_posh/internal/popo/ports/base_port.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" #include "iceoryx_posh/testing/mocks/chunk_mock.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" #include @@ -81,7 +81,7 @@ class ChunkSender_test : public Test static constexpr uint32_t USER_HEADER_SIZE = iox::CHUNK_NO_USER_HEADER_SIZE; static constexpr uint32_t USER_HEADER_ALIGNMENT = iox::CHUNK_NO_USER_HEADER_ALIGNMENT; - iox::posix::Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; iox::mepoo::MePooConfig m_mempoolconf; iox::mepoo::MemoryManager m_memoryManager; diff --git a/iceoryx_posh/test/moduletests/test_popo_client_port.cpp b/iceoryx_posh/test/moduletests/test_popo_client_port.cpp index 3df4de8eac9..ed99eb5fd74 100644 --- a/iceoryx_posh/test/moduletests/test_popo_client_port.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_client_port.cpp @@ -170,7 +170,7 @@ class ClientPort_test : public Test static constexpr uint32_t CHUNK_SIZE = 128U; static constexpr size_t MEMORY_SIZE = 1024U * 1024U; uint8_t m_memory[MEMORY_SIZE]; - iox::posix::Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; iox::mepoo::MemoryManager m_memoryManager; ServiceDescription m_serviceDescription{"hyp", "no", "toad"}; diff --git a/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp b/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp index 3521dcd7ec8..06715bf0fa3 100644 --- a/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_publisher_port.cpp @@ -16,7 +16,6 @@ // SPDX-License-Identifier: Apache-2.0 #include "iceoryx_hoofs/cxx/scope_guard.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp" @@ -26,6 +25,7 @@ #include "iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp" #include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" #include @@ -73,7 +73,7 @@ class PublisherPort_test : public Test using ChunkQueueData_t = iox::popo::ChunkQueueData; - iox::posix::Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; iox::mepoo::MePooConfig m_mempoolconf; iox::mepoo::MemoryManager m_memoryManager; diff --git a/iceoryx_posh/test/moduletests/test_popo_server_port_common.hpp b/iceoryx_posh/test/moduletests/test_popo_server_port_common.hpp index d8dcbfeed48..c6b2416f8ac 100644 --- a/iceoryx_posh/test/moduletests/test_popo_server_port_common.hpp +++ b/iceoryx_posh/test/moduletests/test_popo_server_port_common.hpp @@ -185,7 +185,7 @@ class ServerPort_test : public Test static constexpr uint32_t CHUNK_SIZE = 128U; static constexpr size_t MEMORY_SIZE = 1024U * 1024U; uint8_t m_memory[MEMORY_SIZE]; - iox::posix::Allocator m_memoryAllocator{m_memory, MEMORY_SIZE}; + iox::BumpAllocator m_memoryAllocator{m_memory, MEMORY_SIZE}; MemoryManager m_memoryManager; ServiceDescription m_serviceDescription{"hyp", "no", "toad"}; diff --git a/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp b/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp index 03dfc0e5337..ba2ad676c3a 100644 --- a/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_subscriber_port.cpp @@ -25,7 +25,6 @@ #include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp" #include "iceoryx_posh/popo/subscriber_options.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/error_handling/error_handling.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" #include "test.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_used_chunk_list.cpp b/iceoryx_posh/test/moduletests/test_popo_used_chunk_list.cpp index 948cf7bd0cd..60e426deec0 100644 --- a/iceoryx_posh/test/moduletests/test_popo_used_chunk_list.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_used_chunk_list.cpp @@ -16,9 +16,9 @@ #include "iceoryx_posh/internal/popo/used_chunk_list.hpp" -#include "iceoryx_hoofs/internal/posix_wrapper/shared_memory_object/allocator.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" #include "iceoryx_posh/mepoo/mepoo_config.hpp" +#include "iox/bump_allocator.hpp" #include "test.hpp" @@ -38,7 +38,7 @@ class UsedChunkList_test : public Test MePooConfig mempoolconf; mempoolconf.addMemPool({CHUNK_SIZE, NUM_CHUNKS_IN_POOL}); - iox::posix::Allocator memoryAllocator{m_memory.get(), MEMORY_SIZE}; + iox::BumpAllocator memoryAllocator{m_memory.get(), MEMORY_SIZE}; memoryManager.configureMemoryManager(mempoolconf, memoryAllocator, memoryAllocator); };