mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: introduce, use funcPC to convert Go func to PC
This removes the ** unsafe hack. Real bug fixed at chan.go:101. LGTM=dave, r, iant R=golang-codereviews, dave, r, iant CC=dvyukov, golang-codereviews, khr https://golang.org/cl/140870044
This commit is contained in:
parent
2c780a35b9
commit
0e07f1c99f
9 changed files with 33 additions and 72 deletions
|
|
@ -86,7 +86,7 @@ func ParForSetup(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*
|
|||
mp := acquirem()
|
||||
mp.ptrarg[0] = unsafe.Pointer(desc)
|
||||
mp.ptrarg[1] = unsafe.Pointer(ctx)
|
||||
mp.ptrarg[2] = **(**unsafe.Pointer)(unsafe.Pointer(&body))
|
||||
mp.ptrarg[2] = unsafe.Pointer(funcPC(body)) // TODO(rsc): Should be a scalar.
|
||||
mp.scalararg[0] = uintptr(nthr)
|
||||
mp.scalararg[1] = uintptr(n)
|
||||
mp.scalararg[2] = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue