Skip to content

Commit

Permalink
Fix on stack allocator (alibaba#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
Coldwings committed Jun 27, 2024
1 parent 9c1bcd3 commit 7c59780
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion thread/stack-allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c59780

Please sign in to comment.