From 42b11d403d91e25754fe60c63c26371fbb7a89a9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 7 Jan 2016 18:37:46 -0800 Subject: handles, merge, odb: changes for Go 1.6 pointer passing rules See http://tip.golang.org/cmd/cgo/#hdr-Passing_pointers . --- handles.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'handles.go') 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() -- cgit v1.2.3