1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:08:33 -06:00

runtime: remove unused return value from lfstackUnpack

None of the two places that call lfstackUnpack use the second argument.
This simplifies a followup CL that merges the lfstack{Pack,Unpack}
implementations.

Change-Id: I3c93f6259da99e113d94f8c8027584da79c1ac2c
Reviewed-on: https://go-review.googlesource.com/21595
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Dave Cheney 2016-04-06 18:43:23 +10:00
parent 04945edd40
commit 0c81248bf4
4 changed files with 8 additions and 14 deletions

View File

@ -15,7 +15,7 @@ import (
func lfstackpush(head *uint64, node *lfnode) { func lfstackpush(head *uint64, node *lfnode) {
node.pushcnt++ node.pushcnt++
new := lfstackPack(node, node.pushcnt) new := lfstackPack(node, node.pushcnt)
if node1, _ := lfstackUnpack(new); node1 != node { if node1 := lfstackUnpack(new); node1 != node {
print("runtime: lfstackpush invalid packing: node=", node, " cnt=", hex(node.pushcnt), " packed=", hex(new), " -> node=", node1, "\n") print("runtime: lfstackpush invalid packing: node=", node, " cnt=", hex(node.pushcnt), " packed=", hex(new), " -> node=", node1, "\n")
throw("lfstackpush") throw("lfstackpush")
} }
@ -34,7 +34,7 @@ func lfstackpop(head *uint64) unsafe.Pointer {
if old == 0 { if old == 0 {
return nil return nil
} }
node, _ := lfstackUnpack(old) node := lfstackUnpack(old)
next := atomic.Load64(&node.next) next := atomic.Load64(&node.next)
if atomic.Cas64(head, old, next) { if atomic.Cas64(head, old, next) {
return unsafe.Pointer(node) return unsafe.Pointer(node)

View File

@ -14,8 +14,6 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
return uint64(uintptr(unsafe.Pointer(node)))<<32 | uint64(cnt) return uint64(uintptr(unsafe.Pointer(node)))<<32 | uint64(cnt)
} }
func lfstackUnpack(val uint64) (node *lfnode, cnt uintptr) { func lfstackUnpack(val uint64) *lfnode {
node = (*lfnode)(unsafe.Pointer(uintptr(val >> 32))) return (*lfnode)(unsafe.Pointer(uintptr(val >> 32)))
cnt = uintptr(val)
return
} }

View File

@ -28,8 +28,6 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
return uint64(uintptr(unsafe.Pointer(node)))<<(64-addrBits) | uint64(cnt&(1<<cntBits-1)) return uint64(uintptr(unsafe.Pointer(node)))<<(64-addrBits) | uint64(cnt&(1<<cntBits-1))
} }
func lfstackUnpack(val uint64) (node *lfnode, cnt uintptr) { func lfstackUnpack(val uint64) *lfnode {
node = (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3))) return (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3)))
cnt = uintptr(val & (1<<cntBits - 1))
return
} }

View File

@ -17,8 +17,6 @@ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
return uint64(uintptr(unsafe.Pointer(node)))<<16 | uint64(cnt&(1<<19-1)) return uint64(uintptr(unsafe.Pointer(node)))<<16 | uint64(cnt&(1<<19-1))
} }
func lfstackUnpack(val uint64) (node *lfnode, cnt uintptr) { func lfstackUnpack(val uint64) *lfnode {
node = (*lfnode)(unsafe.Pointer(uintptr(int64(val) >> 19 << 3))) return (*lfnode)(unsafe.Pointer(uintptr(int64(val) >> 19 << 3)))
cnt = uintptr(val & (1<<19 - 1))
return
} }