authorgravatar for kiedtl@tilde.teamKiëd Llaentenn <kiedtl@tilde.team> 2025-02-21 13:00:17-05:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-22 03:48:09+01:00
logd31bda13cb1ece7dd2ba22339172a8704a84823c
treebf7e5b7a613a8736e467d8c4f7aece44177b291f
parent339b628d4c8a850c6d819e88fb3b84b86e8b5927

std.atomic: make cache_line const a comptime_int

This fixes potential issues and unintended coercions in other areas, such as std.ArrayList.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/atomic.zig+1-1
...@@ -482,7 +482,7 @@ pub fn cacheLineForCpu(cpu: std.Target.Cpu) u16 {...@@ -482,7 +482,7 @@ pub fn cacheLineForCpu(cpu: std.Target.Cpu) u16 {
482///482///
483/// https://en.wikipedia.org/wiki/False_sharing483/// https://en.wikipedia.org/wiki/False_sharing
484/// https://github.com/golang/go/search?q=CacheLinePadSize484/// https://github.com/golang/go/search?q=CacheLinePadSize
485pub const cache_line = cacheLineForCpu(builtin.cpu);485pub const cache_line: comptime_int = cacheLineForCpu(builtin.cpu);
486486
487test "current CPU has a cache line size" {487test "current CPU has a cache line size" {
488 _ = cache_line;488 _ = cache_line;