Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix on stack allocator #518

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Fix on stack allocator #518

merged 1 commit into from
Jun 27, 2024

Conversation

Coldwings
Copy link
Collaborator

When slog is empty, should alloc memory with size fit in slot.

@Coldwings Coldwings requested review from lihuiba and beef9999 June 25, 2024 02:08
@@ -96,9 +96,10 @@ class PooledStackAllocator {
return __alloc(size);
}
auto ptr = slots[idx].get();
auto aligned_size = MIN_ALLOCATION_SIZE << idx;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not put it in the scope of the following if

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good

@lihuiba lihuiba merged commit 7c59780 into alibaba:main Jun 27, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants