2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
7 #include "IMemoryPool.hpp"
9 #include "arm_compute/runtime/IAllocator.h"
10 #include "arm_compute/runtime/Types.h"
15 class OffsetMemoryPool : public IMemoryPool
18 OffsetMemoryPool(arm_compute::IAllocator* allocator, size_t blobSize);
22 OffsetMemoryPool(const OffsetMemoryPool&) = delete;
24 OffsetMemoryPool& operator=(const OffsetMemoryPool&) = delete;
26 OffsetMemoryPool(OffsetMemoryPool&&) = default;
28 OffsetMemoryPool& operator=(OffsetMemoryPool &&) = default;
30 void acquire(arm_compute::MemoryMappings& handles) override;
31 void release(arm_compute::MemoryMappings& handles) override;
33 arm_compute::MappingType mapping_type() const override;
35 std::unique_ptr<arm_compute::IMemoryPool> duplicate() override;
37 void AllocatePool() override;
38 void ReleasePool() override;
41 /// Allocator to use for internal allocation
42 arm_compute::IAllocator* m_Allocator;
47 /// Size of the allocated memory blob
50 /// Flag indicating whether memory has been allocated for the pool
51 bool m_MemoryAllocated;