mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] runtime: replace uses of runtime/internal/sys.PtrSize with internal/goarch.PtrSize [generated]
[git-generate] cd src/runtime/internal/math gofmt -w -r "sys.PtrSize -> goarch.PtrSize" . goimports -w *.go cd ../.. gofmt -w -r "sys.PtrSize -> goarch.PtrSize" . goimports -w *.go Change-Id: I43491cdd54d2e06d4d04152b3d213851b7d6d423 Reviewed-on: https://go-review.googlesource.com/c/go/+/328337 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
122f5e16d6
commit
6d85891b29
63 changed files with 349 additions and 336 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"internal/abi"
|
||||
"runtime/internal/math"
|
||||
"runtime/internal/sys"
|
||||
"internal/goarch"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
|
|
@ -195,15 +196,15 @@ func growslice(et *_type, old slice, cap int) slice {
|
|||
capmem = roundupsize(uintptr(newcap))
|
||||
overflow = uintptr(newcap) > maxAlloc
|
||||
newcap = int(capmem)
|
||||
case et.size == sys.PtrSize:
|
||||
lenmem = uintptr(old.len) * sys.PtrSize
|
||||
newlenmem = uintptr(cap) * sys.PtrSize
|
||||
capmem = roundupsize(uintptr(newcap) * sys.PtrSize)
|
||||
overflow = uintptr(newcap) > maxAlloc/sys.PtrSize
|
||||
newcap = int(capmem / sys.PtrSize)
|
||||
case et.size == goarch.PtrSize:
|
||||
lenmem = uintptr(old.len) * goarch.PtrSize
|
||||
newlenmem = uintptr(cap) * goarch.PtrSize
|
||||
capmem = roundupsize(uintptr(newcap) * goarch.PtrSize)
|
||||
overflow = uintptr(newcap) > maxAlloc/goarch.PtrSize
|
||||
newcap = int(capmem / goarch.PtrSize)
|
||||
case isPowerOfTwo(et.size):
|
||||
var shift uintptr
|
||||
if sys.PtrSize == 8 {
|
||||
if goarch.PtrSize == 8 {
|
||||
// Mask shift for better code generation.
|
||||
shift = uintptr(sys.Ctz64(uint64(et.size))) & 63
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue