mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: merge slice and sliceStruct
By removing type slice, renaming type sliceStruct to type slice and whacking until it compiles. Has a pleasing net reduction of conversions. Fixes #10188 Change-Id: I77202b8df637185b632fd7875a1fdd8d52c7a83c Reviewed-on: https://go-review.googlesource.com/8770 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
f7be77e5b6
commit
ab4df700b8
10 changed files with 36 additions and 46 deletions
|
|
@ -76,8 +76,10 @@ func GCMask(x interface{}) (ret []byte) {
|
|||
s := (*slice)(unsafe.Pointer(&ret))
|
||||
systemstack(func() {
|
||||
var len uintptr
|
||||
getgcmask(e.data, e._type, &s.array, &len)
|
||||
s.len = uint(len)
|
||||
var a *byte
|
||||
getgcmask(e.data, e._type, &a, &len)
|
||||
s.array = unsafe.Pointer(a)
|
||||
s.len = int(len)
|
||||
s.cap = s.len
|
||||
})
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue