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

[1.0-beta4 -> main] Use our own hardware_destructive_interference_sz to avoid GCC warning #478

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Aug 6, 2024

Avoid GCC warning:

libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: warning: use of ‘std::hardware_destructive_interference_size’ [-Winterference-size]
   28 |       alignas(hardware_destructive_interference_size)
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: its value can vary between compiler versions or with different ‘-mtune’ or ‘-mcpu’ flags
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: if this use is part of a public ABI, change it to instead use a constant variable you define
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: the default value for the current CPU tuning is 64 bytes
libraries/chain/include/eosio/chain/thread_utils.hpp:28:15: note: you can stabilize this value with ‘--param hardware_destructive_interference_size=64’, or disable this warning with ‘-Wno-interference-size’

Declare and use our own hardware_destructive_interference_size set to 64 which should be sufficient for our supported platforms. Rename to hardware_destructive_interference_sz to avoid confusing with std::hardware_destructive_interference_size.

See also #41

Merges release/1.0-beta4 into main including #474

@heifner heifner requested review from greg7mdp and spoonincode August 6, 2024 12:00
@heifner heifner added the OCI Work exclusive to OCI team label Aug 6, 2024
@heifner heifner merged commit e3d337b into main Aug 6, 2024
36 checks passed
@heifner heifner deleted the gcc-warn-main branch August 6, 2024 14:13
@ericpassmore
Copy link
Contributor

Note:start
group: CLEANCODE
category: INTERNALS
summary: Use our own hardware_destructive_interference_sz to avoid GCC warning.
Note:end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants