diff --git a/shared/source/utilities/buffer_pool_allocator.inl b/shared/source/utilities/buffer_pool_allocator.inl index b50d5e1950..7f90961bfe 100644 --- a/shared/source/utilities/buffer_pool_allocator.inl +++ b/shared/source/utilities/buffer_pool_allocator.inl @@ -11,6 +11,7 @@ #include "shared/source/utilities/heap_allocator.h" #include +#include namespace NEO { @@ -20,11 +21,11 @@ inline SmallBuffersParams SmallBuffersParams::getPreferredBufferPoolParams(const template AbstractBuffersPool::AbstractBuffersPool(MemoryManager *memoryManager, OnChunkFreeCallback onChunkFreeCb) - : AbstractBuffersPool::AbstractBuffersPool(memoryManager, onChunkFreeCb, SmallBuffersParams::getDefaultParams()) {} + : AbstractBuffersPool::AbstractBuffersPool(memoryManager, std::move(onChunkFreeCb), SmallBuffersParams::getDefaultParams()) {} template AbstractBuffersPool::AbstractBuffersPool(MemoryManager *memoryManager, OnChunkFreeCallback onChunkFreeCb, const SmallBuffersParams ¶ms) - : memoryManager{memoryManager}, onChunkFreeCallback{onChunkFreeCb}, params{params} { + : memoryManager{memoryManager}, onChunkFreeCallback{std::move(onChunkFreeCb)}, params{params} { static_assert(std::is_base_of_v); } @@ -33,7 +34,7 @@ AbstractBuffersPool::AbstractBuffersPool(Ab : memoryManager{bufferPool.memoryManager}, mainStorage{std::move(bufferPool.mainStorage)}, chunkAllocator{std::move(bufferPool.chunkAllocator)}, - onChunkFreeCallback{bufferPool.onChunkFreeCallback}, + onChunkFreeCallback{std::move(bufferPool.onChunkFreeCallback)}, params{bufferPool.params} {} template