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

Move barrier macros from <atomic> to <xatomic.h> #3124

Merged
merged 7 commits into from
Oct 24, 2022

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Sep 23, 2022

Towards #3048.

@MattStephanson @barcharcraz

I think we can include <xatomic.h> in locale0.cpp once this PR gets merged as <xatomic.h> has been made a core header, and avoid the third copy of these macro definitions. This should have no undesired impact on the size of import library.

I guess these macros should still be #undefed in <atomic>, so I copied the comments in <atomic> with modifications.

The separated #undef directives in <atomic> are being removed.

But I guess they should be still `#undef`ed in `<atomic>`.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner September 23, 2022 07:22
Strangely, some failures occured in formerly verified portions.
stl/inc/xatomic.h Outdated Show resolved Hide resolved
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Sep 25, 2022
@strega-nil-ms
Copy link
Contributor

I really don't like this split of the #define and the #undef...

@barcharcraz
Copy link
Member

The lack of undefs would normally break what's in vcruntime, however, that stuff is all C only, and the header will #error in C++ mode, so I think it's OK.

Copy link
Member

@barcharcraz barcharcraz left a comment

Choose a reason for hiding this comment

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

I like this change; however, we should probably avoid making the stray formatting changes (approved anyways as it's trivial to revert them if they end up getting into main)

stl/inc/atomic Show resolved Hide resolved
@barcharcraz barcharcraz removed their assignment Oct 17, 2022
@StephanTLavavej StephanTLavavej self-assigned this Oct 21, 2022
@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 61be383 into microsoft:main Oct 24, 2022
@StephanTLavavej
Copy link
Member

Thanks for reorganizing this atomics code! ☢️ 😹 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants