-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-108337: Add pyatomic.h header #108701
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
gh-108337: Add pyatomic.h header #108701
Conversation
This PR is a copy of PR #108338 with my changes:
|
cc @colesbury |
Out of curiosity, https://clang.llvm.org/docs/LanguageExtensions.html#langext-c11-atomic |
Are there advantages on using these clang functions, instead of using the pyatomic_gcc.h on clang? |
@vstinner, no, both sets of intrinsics work fine on Clang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vstinner, this looks good to me
PR rebased on the main branch to fix the merge conflict. |
This adds a new header that provides atomic operations on common data types. The intention is that this will be exposed through Python.h, although that is not the case yet. The only immediate use is in the test file.
The final commit look like this:
Locally, Sam Gross was the author. I don't understand how GitHub merge works. It seems to change the author, sorry about that :-( I'm not used to "copy" a PR to propose some changes. |
Thanks @colesbury, that's a nice addition! It looks better than |
This adds a new header that provides atomic operations on common data types. The intention is that this will be exposed through Python.h, although that is not the case yet. The only immediate use is in the test file.
📚 Documentation preview 📚: https://cpython-previews--108701.org.readthedocs.build/