diff options
author | Austin Clements <austin@google.com> | 2016-04-29 15:19:11 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-04-30 16:49:50 +0000 |
commit | d5e3d08b3ad0048c540727b5512f29ecc70ef51a (patch) | |
tree | a8b4adb31eddfb63ab5dc24127f74bc3724e4f00 /src/runtime/cgocall.go | |
parent | a5d3f7ece9033393166d0c74cd1121c15032ba4d (diff) | |
download | go-d5e3d08b3ad0048c540727b5512f29ecc70ef51a.tar.gz go-d5e3d08b3ad0048c540727b5512f29ecc70ef51a.zip |
runtime: use morePointers and isPointer in more places
This makes this code better self-documenting and makes it easier to
find these places in the future.
Change-Id: I31dc5598ae67f937fb9ef26df92fd41d01e983c3
Reviewed-on: https://go-review.googlesource.com/22631
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/cgocall.go')
-rw-r--r-- | src/runtime/cgocall.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index fa996d2405..887343edd1 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -559,12 +559,11 @@ func cgoCheckUnknownPointer(p unsafe.Pointer, msg string) (base, i uintptr) { } n := span.elemsize for i = uintptr(0); i < n; i += sys.PtrSize { - bits := hbits.bits() - if i >= 2*sys.PtrSize && bits&bitMarked == 0 { + if i >= 2*sys.PtrSize && !hbits.morePointers() { // No more possible pointers. break } - if bits&bitPointer != 0 { + if hbits.isPointer() { if cgoIsGoPointer(*(*unsafe.Pointer)(unsafe.Pointer(base + i))) { panic(errorString(msg)) } |