aboutsummaryrefslogtreecommitdiff
path: root/src/database
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2022-05-17 15:52:20 -0700
committerKeith Randall <khr@golang.org>2022-05-19 20:10:40 +0000
commit6b6813fdb79d426c3693eef2cc423263185cb3a2 (patch)
tree7923dcc44746c49751f7a243eb486691e105841f /src/database
parent9b89c380208ea2e85985ee6bf2b1d684274dfa1d (diff)
downloadgo-6b6813fdb79d426c3693eef2cc423263185cb3a2.tar.xz
runtime: test alignment of fields targeted by 64-bit atomics
Make sure that all the targets of 64-bit atomic operations are actually aligned to 8 bytes. This has been a source of bugs on 32-bit systems. (e.g. CL 399754) The strategy is to have a simple test that just checks the alignment of some explicitly listed fields and global variables. Then there's a more complicated test that makes sure the list used in the simple test is exhaustive. That test has some limitations, but it should catch most cases, particularly new uses of atomic operations on new or existing fields. Unlike a runtime assert, this check is free and will catch accesses that occur even in very unlikely code paths. Change-Id: I25ac78df471ac33b57cb91375bd8453d6ce2814f Reviewed-on: https://go-review.googlesource.com/c/go/+/407034 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/database')
0 files changed, 0 insertions, 0 deletions