Skip to content

[libc++] Fix insert() calling incorrect constructors #146231

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

philnik777
Copy link
Contributor

This fixes insert() calling the wrong allocator_traits::construct in the associative containers by removing the special handling that lead to the inconsistencty inside __tree.

@EricWF
Copy link
Member

EricWF commented Jun 29, 2025

Are you at all concerned by the removal of the optimizations here?

Could we add some tests to establish exactly how much performance is being lost?

@EricWF EricWF self-assigned this Jun 29, 2025
@philnik777
Copy link
Contributor Author

Are you at all concerned by the removal of the optimizations here?

Could we add some tests to establish exactly how much performance is being lost?

Could you elaborate which optimizations you are talking about? AFAICT __emplace_unique does the same unwrapping __insert_unique does (though, granted, with a bit more metaprogramming trickery).

@EricWF
Copy link
Member

EricWF commented Jun 30, 2025

Are you at all concerned by the removal of the optimizations here?
Could we add some tests to establish exactly how much performance is being lost?

Could you elaborate which optimizations you are talking about? AFAICT __emplace_unique does the same unwrapping __insert_unique does (though, granted, with a bit more metaprogramming trickery).

You're right. I misread the diff.

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