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;
|
||||
|
||||
public:
|
||||
template <typename GivenAllocatorT = UnderlyingAllocatorT>
|
||||
OpaqueElementAllocator(size_t chunkSize, size_t alignedElementSize,
|
||||
UnderlyingAllocatorT underlyingAllocator) : chunkSize(chunkSize), alignedElementSize(alignedElementSize),
|
||||
underlyingAllocator(std::move(underlyingAllocator)) {
|
||||
GivenAllocatorT &&underlyingAllocator) : chunkSize(chunkSize), alignedElementSize(alignedElementSize),
|
||||
underlyingAllocator(std::forward<GivenAllocatorT>(underlyingAllocator)) {
|
||||
UNRECOVERABLE_IF(chunkSize < alignedElementSize);
|
||||
DEBUG_BREAK_IF((chunkSize % alignedElementSize) != 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user