Skip to content

Commit

Permalink
Fix on stack allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
Coldwings committed Jun 25, 2024
1 parent 5a31854 commit 47aa85b
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 @@ -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;
Expand Down

0 comments on commit 47aa85b

Please sign in to comment.