Fix potential bug on memory pool (#1299)
This commit is contained in:
parent
e617ff9b59
commit
0d9bd5554c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user