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

Reallocate at least #3864

Merged
merged 6 commits into from
Jul 14, 2023
Merged

Conversation

CaseyCarter
Copy link
Member

This reverts the reversion of #3712 from #3819. It also detects allocators publicly derived from std::allocator, and refuses to use allocate_at_least in such a case to avoid potential mismatch between a user's deallocate and the default allocate_at_least.

I expect we'll squash merge this, but I've kept it as two separate commits for ease of review: one that reverts the revert, and one that implements the fix.

.... since pre-C++23 allocators may override `deallocate` in a way that is not compatible with `std::allocator::allocate_at_least`.
@CaseyCarter CaseyCarter added the performance Must go faster label Jul 11, 2023
@CaseyCarter CaseyCarter requested a review from a team as a code owner July 11, 2023 18:39
stl/inc/xmemory Outdated Show resolved Hide resolved
stl/inc/xmemory Outdated Show resolved Hide resolved
tests/std/tests/GH_003570_allocate_at_least/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/GH_003570_allocate_at_least/test.cpp Outdated Show resolved Hide resolved
tests/std/tests/GH_003570_allocate_at_least/test.cpp Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej removed their assignment Jul 13, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jul 13, 2023
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 171066e into microsoft:main Jul 14, 2023
35 checks passed
@StephanTLavavej
Copy link
Member

Thanks for restoring this optimization! May the RWC be ever in your favor. 😹 🚀 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants