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

<memory>: ADL-proof implementation of shared_ptr creation functions and atomic smart pointers #4403

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

Towards #140 and #3100.

Notes:

  • _Fill_memset is _STD-qualified for consistency, although it seems that _Fill_memset is never used with "weird" types.
  • All _Make_shared_unbounded_array and _Allocate_shared_unbounded_array overloads are consistently _STD-qualified even though some don't need.
  • One _Deallocate call is _STD-qualified as drive-by since Properly destroy vector<shared_ptr<uninstantiable>> #4373 started to do this.
    • The remaining unqualified _Deallocate call are all related to function and will be handled in a future PR.
  • _STD addressof(meow) is used in some places instead of &. This seems necessary even if no ADL-incompatible type is involved, because an overloaded unary operator& can still do evil.
  • In the test codes, adl_proof_allocator is invented. Because the equality comparison of std::allocator<holder<incomplete>*> is ill-formed, which makes it not actually meet the Cpp17Allocator requirements.

- `_Fill_memset` calls are qualified for consistency.
- One `_Deallocate` call is qualified like a previous PR.
- `_Make_shared_unbounded_array` and `_Allocate_shared_unbounded_array`
overloads are consistently `_STD`-qualified, even though some don't
need.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner February 17, 2024 17:09
@StephanTLavavej StephanTLavavej added the bug Something isn't working label Feb 17, 2024
@StephanTLavavej StephanTLavavej self-assigned this Feb 17, 2024
@StephanTLavavej StephanTLavavej removed their assignment Feb 20, 2024
@StephanTLavavej StephanTLavavej self-assigned this Feb 23, 2024
@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 b31e883 into microsoft:main Feb 27, 2024
37 checks passed
@StephanTLavavej
Copy link
Member

Thanks for sharing these improvements! 😹 🎉 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants