From d959dd97b12f4067c8511fb11493e3bf47eb9737 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 14 Apr 2023 14:36:12 -0700 Subject: runtime: change lfstack support to taggedPointer This is a refactoring with no change in behavior, in preparation for future netpoll work. For #59545 Change-Id: I493c5fd0f49f31b75787f7b5b89c544bed73f64f Reviewed-on: https://go-review.googlesource.com/c/go/+/484836 TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills Auto-Submit: Ian Lance Taylor Reviewed-by: Michael Knyszek Run-TryBot: Ian Lance Taylor Reviewed-by: Orlando Labao --- src/runtime/lfstack.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/runtime/lfstack.go') diff --git a/src/runtime/lfstack.go b/src/runtime/lfstack.go index 306a8e888a..a91ae64e53 100644 --- a/src/runtime/lfstack.go +++ b/src/runtime/lfstack.go @@ -67,3 +67,11 @@ func lfnodeValidate(node *lfnode) { throw("bad lfnode address") } } + +func lfstackPack(node *lfnode, cnt uintptr) uint64 { + return uint64(taggedPointerPack(unsafe.Pointer(node), cnt)) +} + +func lfstackUnpack(val uint64) *lfnode { + return (*lfnode)(taggedPointer(val).pointer()) +} -- cgit v1.3-5-g9baa