diff --git a/nix-meson-build-support/common/meson.build b/nix-meson-build-support/common/meson.build index 5fcf557e7..4488a1760 100644 --- a/nix-meson-build-support/common/meson.build +++ b/nix-meson-build-support/common/meson.build @@ -25,6 +25,7 @@ add_project_arguments( '-Wignored-qualifiers', '-Wimplicit-fallthrough', '-Wno-deprecated-declarations', + '-Wno-interference-size', # Used for C++ ABI only. We don't provide any guarantees about different march tunings. language : 'cpp', ) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 84f14198f..d9d8a986a 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -318,7 +318,6 @@ EvalState::EvalState( countCalls = getEnv("NIX_COUNT_CALLS").value_or("0") != "0"; static_assert(sizeof(Env) <= 16, "environment must be <= 16 bytes"); - static_assert(sizeof(Counter) == 64, "counters must be 64 bytes"); /* Construct the Nix expression search path. */ assert(lookupPath.elements.empty()); diff --git a/src/libexpr/include/nix/expr/counter.hh b/src/libexpr/include/nix/expr/counter.hh index efbf23de3..f679b23ca 100644 --- a/src/libexpr/include/nix/expr/counter.hh +++ b/src/libexpr/include/nix/expr/counter.hh @@ -11,7 +11,7 @@ namespace nix { * variable is set. This is to prevent contention on these counters * when multi-threaded evaluation is enabled. */ -struct alignas(64) Counter +struct alignas(std::hardware_destructive_interference_size) Counter { using value_type = uint64_t;