aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/lfstack.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/lfstack.go')
-rw-r--r--src/runtime/lfstack.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/runtime/lfstack.go b/src/runtime/lfstack.go
index cbec6e8447..8946c80348 100644
--- a/src/runtime/lfstack.go
+++ b/src/runtime/lfstack.go
@@ -24,10 +24,6 @@ type lfstack uint64
func (head *lfstack) push(node *lfnode) {
node.pushcnt++
new := lfstackPack(node, node.pushcnt)
- if node1 := lfstackUnpack(new); node1 != node {
- print("runtime: lfstack.push invalid packing: node=", node, " cnt=", hex(node.pushcnt), " packed=", hex(new), " -> node=", node1, "\n")
- throw("lfstack.push")
- }
for {
old := atomic.Load64((*uint64)(head))
node.next = old
@@ -61,15 +57,11 @@ func lfnodeValidate(node *lfnode) {
if base, _, _ := findObject(uintptr(unsafe.Pointer(node)), 0, 0); base != 0 {
throw("lfstack node allocated from the heap")
}
- if lfstackUnpack(lfstackPack(node, ^uintptr(0))) != node {
- printlock()
- println("runtime: bad lfnode address", hex(uintptr(unsafe.Pointer(node))))
- throw("bad lfnode address")
- }
+ lfstackPack(node, ^uintptr(0))
}
func lfstackPack(node *lfnode, cnt uintptr) uint64 {
- return uint64(taggedPointerPack(unsafe.Pointer(node), cnt))
+ return uint64(taggedPointerPack(unsafe.Pointer(node), cnt&(1<<tagBits-1)))
}
func lfstackUnpack(val uint64) *lfnode {