From 0d9bd5554c74f11111285bbdf75f6c0b8bd2188e Mon Sep 17 00:00:00 2001 From: Antonio Filipovic <61245998+antoniofilipovic@users.noreply.github.com> Date: Tue, 24 Oct 2023 22:31:36 +0200 Subject: [PATCH] Fix potential bug on memory pool (#1299) --- src/utils/memory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/memory.cpp b/src/utils/memory.cpp index 849a7c3b1..8bfbf4220 100644 --- a/src/utils/memory.cpp +++ b/src/utils/memory.cpp @@ -303,6 +303,7 @@ void *PoolResource::DoAllocate(size_t bytes, size_t alignment) { [](const auto &a, const auto &b) { return a.GetBlockSize() < b.GetBlockSize(); }); if (it != pools_.end() && it->GetBlockSize() == block_size) { last_alloc_pool_ = &*it; + last_dealloc_pool_ = &*it; return it->Allocate(); } // We don't have a pool for this block_size, so insert it in the sorted