2014-11-11 15:07:54 -07:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2014-11-21 08:22:18 -07:00
|
|
|
// +build 386 arm nacl
|
2014-11-11 15:07:54 -07:00
|
|
|
|
|
|
|
package runtime
|
|
|
|
|
2014-11-14 10:55:23 -07:00
|
|
|
import "unsafe"
|
|
|
|
|
2014-11-11 15:07:54 -07:00
|
|
|
// On 32-bit systems, the stored uint64 has a 32-bit pointer and 32-bit count.
|
2014-11-14 10:55:23 -07:00
|
|
|
|
|
|
|
func lfstackPack(node *lfnode, cnt uintptr) uint64 {
|
|
|
|
return uint64(uintptr(unsafe.Pointer(node)))<<32 | uint64(cnt)
|
|
|
|
}
|
|
|
|
|
|
|
|
func lfstackUnpack(val uint64) (node *lfnode, cnt uintptr) {
|
|
|
|
node = (*lfnode)(unsafe.Pointer(uintptr(val >> 32)))
|
|
|
|
cnt = uintptr(val)
|
|
|
|
return
|
|
|
|
}
|