aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-16 11:03:11 -0400
committerRuss Cox <rsc@golang.org>2014-09-16 11:03:11 -0400
commitfc469314420f553906a283656ae39bafcf5af1b0 (patch)
treedaaf31ad615c5c56cd9ac1f961e48d2d539551a4 /src/runtime/runtime.go
parentf95beae61d21898710d7d405ac39bc7b3b205c79 (diff)
downloadgo-fc469314420f553906a283656ae39bafcf5af1b0.tar.xz
runtime: remove untyped allocation of ParFor
Now it's two allocations. I don't see much downside to that, since the two pieces were in different cache lines anyway. Rename 'conservative' to 'cgo_conservative_type' and make clear that _cgo_allocate is the only allowed user. This depends on CL 141490043, which removes the other use of conservative (in defer). LGTM=dvyukov, iant R=khr, dvyukov, iant CC=golang-codereviews, rlh https://golang.org/cl/139610043
Diffstat (limited to 'src/runtime/runtime.go')
-rw-r--r--src/runtime/runtime.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go
index d4f7c64a52..dbaea45a66 100644
--- a/src/runtime/runtime.go
+++ b/src/runtime/runtime.go
@@ -39,3 +39,11 @@ func tickspersecond() int64 {
func makeStringSlice(n int) []string {
return make([]string, n)
}
+
+// TODO: Move to parfor.go when parfor.c becomes parfor.go.
+func parforalloc(nthrmax uint32) *parfor {
+ return &parfor{
+ thr: &make([]parforthread, nthrmax)[0],
+ nthrmax: nthrmax,
+ }
+}