briansmith / ring

Safe, fast, small crypto using Rust
Other
3.69k stars 697 forks source link

internal: Add generalized "noinline" attribute support. #1898

Closed briansmith closed 8 months ago

briansmith commented 8 months ago

There are some functions that we never want to be (cross-language) inlined, and we expect to add more. Make it easier to add more, and make it easier to extend this capability to more C compilers.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c4742e0) 96.02% compared to head (1cf34e0) 96.02%. Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1898 +/- ## ======================================= Coverage 96.02% 96.02% ======================================= Files 136 136 Lines 20776 20776 Branches 226 226 ======================================= Hits 19950 19950 Misses 792 792 Partials 34 34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

briansmith commented 8 months ago

The original submission of this PR used standard attirbute syntax [[clang::noinline]] when compiling with clang. But, apparently clang doesn't like mixing __attribute__((...)) syntax with the standard attribute syntax, which was being done in the ADX code. So, I change RING_NOINLINE to use __attribute__((...)) syntax for clang too.