mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 22:08:53 +08:00
refactor: pass underlying allocator by ref
Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
da23da1b0f
commit
a855ce019e
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user