]> Cypherpunks repositories - gostls13.git/commit
runtime: align taggable pointers more so we can use low bits for tag
authorKeith Randall <khr@golang.org>
Tue, 15 Apr 2025 21:55:06 +0000 (14:55 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 24 Apr 2025 04:44:50 +0000 (21:44 -0700)
commit9d0320de2574586f3b0610c1b5fd15b8f9c85dec
tree4e9efc56ee44d4723283fb60e6b7664d865cfa4a
parent702f164ed1a4a64cfa60e10723b9b7344bd3f601
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>
src/runtime/export_test.go
src/runtime/lfstack.go
src/runtime/lfstack_test.go
src/runtime/mgc.go
src/runtime/mspanset.go
src/runtime/netpoll.go
src/runtime/tagptr.go
src/runtime/tagptr_32bit.go
src/runtime/tagptr_64bit.go