refactor: pass underlying allocator by ref

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
This commit is contained in:
Chodor, Jaroslaw
2025-04-17 00:40:37 +00:00
committed by Compute-Runtime-Automation
parent da23da1b0f
commit a855ce019e

View File

@@ -190,9 +190,10 @@ class OpaqueElementAllocator final {
std::vector<ChunkT> chunks; std::vector<ChunkT> chunks;
public: public:
template <typename GivenAllocatorT = UnderlyingAllocatorT>
OpaqueElementAllocator(size_t chunkSize, size_t alignedElementSize, OpaqueElementAllocator(size_t chunkSize, size_t alignedElementSize,
UnderlyingAllocatorT underlyingAllocator) : chunkSize(chunkSize), alignedElementSize(alignedElementSize), GivenAllocatorT &&underlyingAllocator) : chunkSize(chunkSize), alignedElementSize(alignedElementSize),
underlyingAllocator(std::move(underlyingAllocator)) { underlyingAllocator(std::forward<GivenAllocatorT>(underlyingAllocator)) {
UNRECOVERABLE_IF(chunkSize < alignedElementSize); UNRECOVERABLE_IF(chunkSize < alignedElementSize);
DEBUG_BREAK_IF((chunkSize % alignedElementSize) != 0); DEBUG_BREAK_IF((chunkSize % alignedElementSize) != 0);
} }