aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/lfstack_test.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2025-04-15 14:55:06 -0700
committerGopher Robot <gobot@golang.org>2025-04-23 21:44:50 -0700
commit9d0320de2574586f3b0610c1b5fd15b8f9c85dec (patch)
tree4e9efc56ee44d4723283fb60e6b7664d865cfa4a /src/runtime/lfstack_test.go
parent702f164ed1a4a64cfa60e10723b9b7344bd3f601 (diff)
downloadgo-9d0320de2574586f3b0610c1b5fd15b8f9c85dec.tar.xz
runtime: align taggable pointers more so we can use low bits for tag
Currently we assume alignment to 8 bytes, so we can steal the low 3 bits. This CL assumes alignment to 512 bytes, so we can steal the low 9 bits. That's 6 extra bits! Aligning to 512 bytes wastes a bit of space but it is not egregious. Most of the objects that we make tagged pointers to are pretty big. Update #49405 Change-Id: I66fc7784ac1be5f12f285de1d7851d5a6871fb75 Reviewed-on: https://go-review.googlesource.com/c/go/+/665815 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/lfstack_test.go')
-rw-r--r--src/runtime/lfstack_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/lfstack_test.go b/src/runtime/lfstack_test.go
index e36297e541..c356c1e747 100644
--- a/src/runtime/lfstack_test.go
+++ b/src/runtime/lfstack_test.go
@@ -21,7 +21,7 @@ type MyNode struct {
// We require lfstack objects to live outside the heap so that
// checkptr passes on the unsafe shenanigans used.
func allocMyNode(data int) *MyNode {
- n := (*MyNode)(PersistentAlloc(unsafe.Sizeof(MyNode{})))
+ n := (*MyNode)(PersistentAlloc(unsafe.Sizeof(MyNode{}), TagAlign))
LFNodeValidate(&n.LFNode)
n.data = data
return n