From 5bad32c676dfb7ecad1c2f3f0fd208bb67452f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Zwoli=C5=84ski?= Date: Wed, 29 Oct 2025 15:30:52 +0000 Subject: [PATCH] fix: move onChunkFreeCallback in AbstractBuffersPool constructors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian ZwoliƄski --- shared/source/utilities/buffer_pool_allocator.inl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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