]> Cypherpunks repositories - gostls13.git/commit
internal/cpu: add and use cpu.CacheLinePad for padding structs
authorMartin Möhrmann <moehrmann@google.com>
Tue, 5 Jun 2018 06:14:57 +0000 (08:14 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Mon, 20 Aug 2018 15:41:37 +0000 (15:41 +0000)
commit7b9c2c1950c167b16f8b3cda179363ca8df2c1b2
treec61ffffc1adfa204e513cf791c641a2b05a0881f
parent84feb4bbb76c4317652a79f45e3ad2d7c46c5761
internal/cpu: add and use cpu.CacheLinePad for padding structs

Add a CacheLinePad struct type to internal/cpu that has a size of CacheLineSize.
This can be used for padding structs in order to avoid false sharing.

Updates #25203

Change-Id: Icb95ae68d3c711f5f8217140811cad1a1d5be79a
Reviewed-on: https://go-review.googlesource.com/116276
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/internal/cpu/cpu.go