mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-06-15 14:53:08 +03:00
This should reduce the waste of memory on the padding from 128 bytes to 64 bytes on GOARCH=amd64, while preserving bigger padding for platforms with bigger cache line sizes. See https://stackoverflow.com/questions/68320687/why-are-most-cache-line-sizes-designed-to-be-64-byte-instead-of-32-128byte-now Thanks to @tIGO for the hint
11 lines
172 B
Go
11 lines
172 B
Go
package atomicutil
|
|
|
|
import (
|
|
"unsafe"
|
|
|
|
"golang.org/x/sys/cpu"
|
|
)
|
|
|
|
// CacheLineSize is the size of a CPU cache line
|
|
const CacheLineSize = unsafe.Sizeof(cpu.CacheLinePad{})
|