constants.go 421 B

1234567891011121314151617
  1. /*
  2. * This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  5. */
  6. package main
  7. import (
  8. "unsafe"
  9. "golang.org/x/sys/cpu"
  10. )
  11. const CacheLineSize = unsafe.Sizeof(cpu.CacheLinePad{})
  12. // TODO Is there a better way than this lousy guess?
  13. const L1CacheSize = 512 * CacheLineSize