mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: use func value for parfor body
Yet another leftover from C: parfor took a func value for the callback, casted it to an unsafe.Pointer for storage, and then casted it back to a func value to call it. This is unnecessary, so just store the body as a func value. Beyond general cleanup, this also eliminates the last use of unsafe in parfor. Change-Id: Ia904af7c6c443ba75e2699835aee8e9a39b26dd8 Reviewed-on: https://go-review.googlesource.com/3396 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
This commit is contained in:
parent
ebbdf2a14c
commit
428afae027
2 changed files with 9 additions and 11 deletions
|
|
@ -36,7 +36,7 @@ func LFStackPop(head *uint64) *LFNode {
|
|||
}
|
||||
|
||||
type ParFor struct {
|
||||
body *byte
|
||||
body func(*ParFor, uint32)
|
||||
done uint32
|
||||
Nthr uint32
|
||||
thrseq uint32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue