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:
Austin Clements 2015-01-28 15:55:23 -05:00
parent ebbdf2a14c
commit 428afae027
2 changed files with 9 additions and 11 deletions

View file

@ -36,7 +36,7 @@ func LFStackPop(head *uint64) *LFNode {
}
type ParFor struct {
body *byte
body func(*ParFor, uint32)
done uint32
Nthr uint32
thrseq uint32