mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: use unsafe.Slice in getStackMap
CL 362934 added open code for unsafe.Slice, so using it now no longer negatively impacts the performance. Updates #48798 Change-Id: Ifbabe8bc1cc4349c5bcd11586a11fc99bcb388b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/404974 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
579902d0b1
commit
4388faf964
1 changed files with 2 additions and 1 deletions
|
|
@ -1346,7 +1346,8 @@ func getStackMap(frame *stkframe, cache *pcvalueCache, debug bool) (locals, args
|
|||
if p != nil {
|
||||
n := *(*uintptr)(p)
|
||||
p = add(p, goarch.PtrSize)
|
||||
*(*slice)(unsafe.Pointer(&objs)) = slice{array: noescape(p), len: int(n), cap: int(n)}
|
||||
r0 := (*stackObjectRecord)(noescape(p))
|
||||
objs = unsafe.Slice(r0, int(n))
|
||||
// Note: the noescape above is needed to keep
|
||||
// getStackMap from "leaking param content:
|
||||
// frame". That leak propagates up to getgcmask, then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue