From 7c597803832bef0a11b20ba9b8e5f2aa41b539a9 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Thu, 27 Jun 2024 12:17:27 +0800 Subject: [PATCH] Fix on stack allocator (#518) --- thread/stack-allocator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thread/stack-allocator.cpp b/thread/stack-allocator.cpp index a80bc48f..4d572016 100644 --- a/thread/stack-allocator.cpp +++ b/thread/stack-allocator.cpp @@ -98,7 +98,8 @@ class PooledStackAllocator { auto ptr = slots[idx].get(); if (unlikely(!ptr.first)) { // slots[idx] empty - return __alloc(size); + auto aligned_size = MIN_ALLOCATION_SIZE << idx; + return __alloc(aligned_size); } // got from pool in_pool_size -= ptr.second;