diff --git a/thread/stack-allocator.cpp b/thread/stack-allocator.cpp index a80bc48f..a4159c9d 100644 --- a/thread/stack-allocator.cpp +++ b/thread/stack-allocator.cpp @@ -96,9 +96,10 @@ class PooledStackAllocator { return __alloc(size); } auto ptr = slots[idx].get(); + auto aligned_size = MIN_ALLOCATION_SIZE << idx; if (unlikely(!ptr.first)) { // slots[idx] empty - return __alloc(size); + return __alloc(aligned_size); } // got from pool in_pool_size -= ptr.second;