-
Notifications
You must be signed in to change notification settings - Fork 36.7k
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
Introduce platform-agnostic ALWAYS_INLINE
macro
#27575
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
Concept ACK.
src/attributes.h
Outdated
#elif defined(_MSC_VER) | ||
# define ALWAYS_INLINE __forceinline | ||
#else | ||
# define ALWAYS_INLINE inline |
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.
I think it'd be better to error in this case so that we can add another platform exception if necessary. IIRC for the places that we use it, inlining is critical and we might want to design functions differently for platforms where it's not possible.
Especially given the gcc semantics:
Failure to inline such a function is diagnosed as an error.
As-is, I think this is currently a theoretical regression as we might now compile on a platform that would be an error on master.
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.
Mind suggesting an error wording?
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.
How about: #error No known always_inline attribute for this platform.
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! Updated.
`<attributes.h>` has been included in anticipation of the following commit.
-BEGIN VERIFY SCRIPT- sed -i 's/ inline __attribute__((always_inline)) / ALWAYS_INLINE /g' $(git grep -l "inline __attribute__((always_inline))") sed -i 's/ inline __attribute__((always_inline)) / ALWAYS_INLINE /g' $(git grep -l "inline __attribute__((always_inline))") -END VERIFY SCRIPT-
Updated d66232f -> 3f19875 (pr27575.01 -> pr27575.03, diff): |
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.
utACK 3f19875
Guix Build: 4c75c6675a758f8bfddaf3ca395eec58f82078486273bd13c7f03fa949f05f91 guix-build-3f19875d6675/output/aarch64-linux-gnu/SHA256SUMS.part
9736762959e2d9d06c33093ff08db157548fd3f82529cfbace0ceddce0151996 guix-build-3f19875d6675/output/aarch64-linux-gnu/bitcoin-3f19875d6675-aarch64-linux-gnu-debug.tar.gz
a82ceeae1e2b98e65bc363f61648a28e7a0985a2d2e1acc7142c3540ec71e5c4 guix-build-3f19875d6675/output/aarch64-linux-gnu/bitcoin-3f19875d6675-aarch64-linux-gnu.tar.gz
16b8bf25ad364757690cdad86746718e27102895484cecb3e8b7d1c755f5afc9 guix-build-3f19875d6675/output/arm-linux-gnueabihf/SHA256SUMS.part
7453fdbbc1618069db59a0d09c2606e0912ceacc525b53da24f6ea69aa3302f3 guix-build-3f19875d6675/output/arm-linux-gnueabihf/bitcoin-3f19875d6675-arm-linux-gnueabihf-debug.tar.gz
49adcd44a089326474188d83e7dba12c9e4c0cd5dbb14b3c329ddf4580546822 guix-build-3f19875d6675/output/arm-linux-gnueabihf/bitcoin-3f19875d6675-arm-linux-gnueabihf.tar.gz
763a0ae579e28afcfdb388762651668e62811eceed8990771d8069c7d580c51d guix-build-3f19875d6675/output/arm64-apple-darwin/SHA256SUMS.part
c06e23bc828e660cdcddd0ae610700c7d0cbdda1b7603c2dc32a2414bc27e66d guix-build-3f19875d6675/output/arm64-apple-darwin/bitcoin-3f19875d6675-arm64-apple-darwin-unsigned.dmg
da740b2fa3d9bfc372882509ae8ba93edc2bd08d28e1b2559174b764444e2124 guix-build-3f19875d6675/output/arm64-apple-darwin/bitcoin-3f19875d6675-arm64-apple-darwin-unsigned.tar.gz
87a28abfa9b4bf37b374b3a86cb016761e9eceaaaf97d405e43cd1745cbfb03f guix-build-3f19875d6675/output/arm64-apple-darwin/bitcoin-3f19875d6675-arm64-apple-darwin.tar.gz
303683b5c76e7b99ecbcbdea6c6ab80df57b585b5aadf7c19561314ddcc87612 guix-build-3f19875d6675/output/dist-archive/bitcoin-3f19875d6675.tar.gz
86462a494ca5a26afb3d03376e7ccb47a2b347c607d05f517d3de81819256563 guix-build-3f19875d6675/output/powerpc64-linux-gnu/SHA256SUMS.part
43dd3b070b94e63ef570ec5f63e782fe62aaff62795798d3bd9fe3ce95ec3011 guix-build-3f19875d6675/output/powerpc64-linux-gnu/bitcoin-3f19875d6675-powerpc64-linux-gnu-debug.tar.gz
a85a56378b5806945202334afaf0b9f74664cf53ad4cd56159fd6de79c709df8 guix-build-3f19875d6675/output/powerpc64-linux-gnu/bitcoin-3f19875d6675-powerpc64-linux-gnu.tar.gz
9b7b422b55f28bcda4fe9df3cb46a2d2e18295421258a418e2e83b1bb74ad77b guix-build-3f19875d6675/output/powerpc64le-linux-gnu/SHA256SUMS.part
5bb6fd27c3a6880de51928f9149a62e30e5f9e180ba0615628d2a6a2ec931307 guix-build-3f19875d6675/output/powerpc64le-linux-gnu/bitcoin-3f19875d6675-powerpc64le-linux-gnu-debug.tar.gz
8586dfe73c3c8dcc27494c27c2bf122f22f04efeff0d793cf02efd70d2e1f518 guix-build-3f19875d6675/output/powerpc64le-linux-gnu/bitcoin-3f19875d6675-powerpc64le-linux-gnu.tar.gz
1840ba4c99f1e11f19f3587b98cda655b679210420f2a7dd839b89c893fa61f2 guix-build-3f19875d6675/output/riscv64-linux-gnu/SHA256SUMS.part
0239b5a11cd0b04336a49beed03e60cb62117e4eb7c7a288acd649e2facf7a20 guix-build-3f19875d6675/output/riscv64-linux-gnu/bitcoin-3f19875d6675-riscv64-linux-gnu-debug.tar.gz
09bf89ef4675d4fb41b896d1745fe603e8faf2cb047797e399c32a0922e0ddca guix-build-3f19875d6675/output/riscv64-linux-gnu/bitcoin-3f19875d6675-riscv64-linux-gnu.tar.gz
ec9bbabe136249028395992055cc579ffad61f699012d970863131f040273abe guix-build-3f19875d6675/output/x86_64-apple-darwin/SHA256SUMS.part
ef62895c9aad19ebd926a0b7cfa361d7d0d27c43611ae6339c21fa6a8a9b7caa guix-build-3f19875d6675/output/x86_64-apple-darwin/bitcoin-3f19875d6675-x86_64-apple-darwin-unsigned.dmg
a5d2c4f25c02a86a8000d1b45721720d57ff4e5ce8a446a63ac3aea5c6a30329 guix-build-3f19875d6675/output/x86_64-apple-darwin/bitcoin-3f19875d6675-x86_64-apple-darwin-unsigned.tar.gz
f17f94993412e1d9330edca93f00b1b81daddad78ca6a945e3dd3be6356b50a4 guix-build-3f19875d6675/output/x86_64-apple-darwin/bitcoin-3f19875d6675-x86_64-apple-darwin.tar.gz
26eab9761ec719c19ee1eb070d8c7bd43a481e834d6b820c1af7e9223418324f guix-build-3f19875d6675/output/x86_64-linux-gnu/SHA256SUMS.part
a7a73e55336f99f4258494e4635918acf66e533eaf3133b80d7d6dfdc57002c4 guix-build-3f19875d6675/output/x86_64-linux-gnu/bitcoin-3f19875d6675-x86_64-linux-gnu-debug.tar.gz
4d0df4c4277bebac6576b7e47f68d8cf7785195aeef21cae5348fcfcce5a6810 guix-build-3f19875d6675/output/x86_64-linux-gnu/bitcoin-3f19875d6675-x86_64-linux-gnu.tar.gz
81fe0fd97c1d5fb7991ba07a0555d1f7cf25f671b0b376b8586dbecd09a841d2 guix-build-3f19875d6675/output/x86_64-w64-mingw32/SHA256SUMS.part
e656cfb9854930d8f9a84c7ed3751121259c0fbef1c4ac8421e44a1a900d0438 guix-build-3f19875d6675/output/x86_64-w64-mingw32/bitcoin-3f19875d6675-win64-debug.zip
469255c111b52977954fe9db2a555447eb19963c64bcb2ceb02feb79509e4a7c guix-build-3f19875d6675/output/x86_64-w64-mingw32/bitcoin-3f19875d6675-win64-setup-unsigned.exe
41783b4f94917e184c05696e1bff6c896797c38d0d492f96bf55071dd7d06ae3 guix-build-3f19875d6675/output/x86_64-w64-mingw32/bitcoin-3f19875d6675-win64-unsigned.tar.gz
45adf6a0d032b3a207652393888e731f3ca899bb2980688f330a637ded92d11c guix-build-3f19875d6675/output/x86_64-w64-mingw32/bitcoin-3f19875d6675-win64.zip |
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.
ACK 3f19875
Split from #24773 as requested in #24773 (comment).