]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: remove kindNoPointers
authorKeith Randall <khr@google.com>
Mon, 25 Mar 2019 19:34:27 +0000 (12:34 -0700)
committerKeith Randall <khr@golang.org>
Mon, 25 Mar 2019 20:46:35 +0000 (20:46 +0000)
commitdb16de920370892b0241d3fa0617dddff2417a4d
tree3a85666fe3b1d1d16dc457ae286e4f133e0c1ce0
parent501632339f36e7e836ec94958351cee51ee76461
runtime: remove kindNoPointers

We already have the ptrdata field in a type, which encodes exactly
the same information that kindNoPointers does.

My problem with kindNoPointers is that it often leads to
double-negative code like:

   t.kind & kindNoPointers != 0

Much clearer is:

   t.ptrdata == 0

Update #27167

Change-Id: I92307d7f018a6bbe3daca4a4abb4225e359349b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/169157
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
20 files changed:
src/cmd/compile/internal/gc/reflect.go
src/cmd/internal/objabi/typekind.go
src/internal/reflectlite/type.go
src/reflect/export_test.go
src/reflect/swapper.go
src/reflect/type.go
src/runtime/cgocall.go
src/runtime/cgocheck.go
src/runtime/chan.go
src/runtime/heapdump.go
src/runtime/malloc.go
src/runtime/map.go
src/runtime/map_fast32.go
src/runtime/map_fast64.go
src/runtime/map_faststr.go
src/runtime/mbarrier.go
src/runtime/mbitmap.go
src/runtime/mfinal.go
src/runtime/slice.go
src/runtime/typekind.go