summaryrefslogtreecommitdiff
path: root/handles.go
diff options
context:
space:
mode:
authorIan Lance Taylor <[email protected]>2016-01-07 18:37:46 -0800
committerIan Lance Taylor <[email protected]>2016-01-07 18:37:46 -0800
commit42b11d403d91e25754fe60c63c26371fbb7a89a9 (patch)
tree8e5a0c18fb97a3d6b4272640d5a6104a73a4f0df /handles.go
parent4ee13db86de9321cbea21c04c8608fb8f71735f3 (diff)
handles, merge, odb: changes for Go 1.6 pointer passing rules
See http://tip.golang.org/cmd/cgo/#hdr-Passing_pointers .
Diffstat (limited to 'handles.go')
-rw-r--r--handles.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/handles.go b/handles.go
index a062231..a855717 100644
--- a/handles.go
+++ b/handles.go
@@ -52,12 +52,12 @@ func (v *HandleList) Track(pointer interface{}) unsafe.Pointer {
v.Unlock()
- return unsafe.Pointer(&slot)
+ return unsafe.Pointer(uintptr(slot))
}
// Untrack stops tracking the pointer given by the handle
func (v *HandleList) Untrack(handle unsafe.Pointer) {
- slot := *(*int)(handle)
+ slot := int(uintptr(handle))
v.Lock()
@@ -69,7 +69,7 @@ func (v *HandleList) Untrack(handle unsafe.Pointer) {
// Get retrieves the pointer from the given handle
func (v *HandleList) Get(handle unsafe.Pointer) interface{} {
- slot := *(*int)(handle)
+ slot := int(uintptr(handle))
v.RLock()