Memory group */
| 44 | |
| 45 | /** Memory group */ |
| 46 | class MemoryGroup final : public IMemoryGroup |
| 47 | { |
| 48 | public: |
| 49 | /** Default Constructor */ |
| 50 | MemoryGroup(std::shared_ptr<IMemoryManager> = nullptr) noexcept; |
| 51 | /** Default destructor */ |
| 52 | ~MemoryGroup() = default; |
| 53 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 54 | MemoryGroup(const MemoryGroup &) = delete; |
| 55 | /** Prevent instances of this class from being copy assigned (As this class contains pointers) */ |
| 56 | MemoryGroup &operator=(const MemoryGroup &) = delete; |
| 57 | /** Allow instances of this class to be moved */ |
| 58 | MemoryGroup(MemoryGroup &&) = default; |
| 59 | /** Allow instances of this class to be moved */ |
| 60 | MemoryGroup &operator=(MemoryGroup &&) = default; |
| 61 | |
| 62 | // Inherited methods overridden: |
| 63 | void manage(IMemoryManageable *obj) override; |
| 64 | void finalize_memory(IMemoryManageable *obj, IMemory &obj_memory, size_t size, size_t alignment) override; |
| 65 | void acquire() override; |
| 66 | void release() override; |
| 67 | MemoryMappings &mappings() override; |
| 68 | |
| 69 | private: |
| 70 | std::shared_ptr<IMemoryManager> _memory_manager; /**< Memory manager to be used by the group */ |
| 71 | IMemoryPool *_pool; /**< Memory pool that the group is scheduled with */ |
| 72 | MemoryMappings _mappings; /**< Memory mappings of the group */ |
| 73 | }; |
| 74 | |
| 75 | inline MemoryGroup::MemoryGroup(std::shared_ptr<IMemoryManager> memory_manager) noexcept |
| 76 | : _memory_manager(memory_manager), _pool(nullptr), _mappings() |
no outgoing calls
no test coverage detected