mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: move per-type types to internal/abi
Change-Id: I1f031f0f83a94bebe41d3978a91a903dc5bcda66 Reviewed-on: https://go-review.googlesource.com/c/go/+/489276 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
a2838ec5f2
commit
2e93fe0a9f
20 changed files with 392 additions and 523 deletions
|
|
@ -235,7 +235,7 @@ func BenchSetType(n int, x any) {
|
|||
var p unsafe.Pointer
|
||||
switch t.Kind_ & kindMask {
|
||||
case kindPtr:
|
||||
t = (*ptrtype)(unsafe.Pointer(t)).elem
|
||||
t = (*ptrtype)(unsafe.Pointer(t)).Elem
|
||||
size = t.Size_
|
||||
p = e.data
|
||||
case kindSlice:
|
||||
|
|
@ -243,7 +243,7 @@ func BenchSetType(n int, x any) {
|
|||
ptr unsafe.Pointer
|
||||
len, cap uintptr
|
||||
})(e.data)
|
||||
t = (*slicetype)(unsafe.Pointer(t)).elem
|
||||
t = (*slicetype)(unsafe.Pointer(t)).Elem
|
||||
size = t.Size_ * slice.len
|
||||
p = slice.ptr
|
||||
}
|
||||
|
|
@ -602,7 +602,7 @@ func MapTombstoneCheck(m map[int]int) {
|
|||
t := *(**maptype)(unsafe.Pointer(&i))
|
||||
|
||||
for x := 0; x < 1<<h.B; x++ {
|
||||
b0 := (*bmap)(add(h.buckets, uintptr(x)*uintptr(t.bucketsize)))
|
||||
b0 := (*bmap)(add(h.buckets, uintptr(x)*uintptr(t.BucketSize)))
|
||||
n := 0
|
||||
for b := b0; b != nil; b = b.overflow(t) {
|
||||
for i := 0; i < bucketCnt; i++ {
|
||||
|
|
@ -1757,7 +1757,7 @@ func (a *UserArena) New(out *any) {
|
|||
if typ.Kind_&kindMask != kindPtr {
|
||||
panic("new result of non-ptr type")
|
||||
}
|
||||
typ = (*ptrtype)(unsafe.Pointer(typ)).elem
|
||||
typ = (*ptrtype)(unsafe.Pointer(typ)).Elem
|
||||
i.data = a.arena.new(typ)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue