mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] reflect: use goarch.PtrSize instead of the duplicated ptrSize [generated]
[git-generate] cd src/reflect gofmt -w -r "PtrSize -> goarch.PtrSize" . gofmt -w -r "ptrSize -> goarch.PtrSize" . goimports -w *.go Change-Id: Ib534bb0ecde10d93f45365ab4f8efd620d6d2ef3 Reviewed-on: https://go-review.googlesource.com/c/go/+/328346 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
2e600fb8b3
commit
95c104ee61
6 changed files with 83 additions and 77 deletions
|
|
@ -5,6 +5,7 @@
|
|||
package reflect
|
||||
|
||||
import (
|
||||
"internal/goarch"
|
||||
"sync"
|
||||
"unsafe"
|
||||
)
|
||||
|
|
@ -22,7 +23,7 @@ func IsRO(v Value) bool {
|
|||
|
||||
var CallGC = &callGC
|
||||
|
||||
const PtrSize = ptrSize
|
||||
const PtrSize = goarch.PtrSize
|
||||
|
||||
// FuncLayout calls funcLayout and returns a subset of the results for testing.
|
||||
//
|
||||
|
|
@ -65,7 +66,7 @@ func FuncLayout(t Type, rcvr Type) (frametype Type, argSize, retOffset uintptr,
|
|||
// Expand frame type's GC bitmap into byte-map.
|
||||
ptrs = ft.ptrdata != 0
|
||||
if ptrs {
|
||||
nptrs := ft.ptrdata / ptrSize
|
||||
nptrs := ft.ptrdata / goarch.PtrSize
|
||||
gcdata := ft.gcSlice(0, (nptrs+7)/8)
|
||||
for i := uintptr(0); i < nptrs; i++ {
|
||||
gc = append(gc, gcdata[i/8]>>(i%8)&1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue