aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2021-06-08 18:45:18 -0400
committerCherry Mui <cherryyz@google.com>2021-06-11 18:33:07 +0000
commite0e9fb8affbe37c2ff73b9afb60f726e747f428d (patch)
tree6a3fa8b8e487eab8ac3434bb21e7174d22c2266f /src/runtime/runtime2.go
parent4468e1cfb94ed07fea5514dce740180fd3a6d20f (diff)
downloadgo-e0e9fb8affbe37c2ff73b9afb60f726e747f428d.tar.gz
go-e0e9fb8affbe37c2ff73b9afb60f726e747f428d.zip
[dev.typeparams] runtime: simplify defer record allocation
Now that deferred functions are always argumentless and defer records are no longer with arguments, defer record can be fixed size (just the _defer struct). This allows us to simplify the allocation of defer records, specifically, remove the defer classes and the pools of different sized defers. Change-Id: Icc4b16afc23b38262ca9dd1f7369ad40874cf701 Reviewed-on: https://go-review.googlesource.com/c/go/+/326062 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index cf4b0bff43..75c4818599 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -613,8 +613,8 @@ type p struct {
pcache pageCache
raceprocctx uintptr
- deferpool [5][]*_defer // pool of available defer structs of different sizes (see panic.go)
- deferpoolbuf [5][32]*_defer
+ deferpool []*_defer // pool of available defer structs (see panic.go)
+ deferpoolbuf [32]*_defer
// Cache of goroutine ids, amortizes accesses to runtime·sched.goidgen.
goidcache uint64
@@ -801,9 +801,9 @@ type schedt struct {
sudoglock mutex
sudogcache *sudog
- // Central pool of available defer structs of different sizes.
+ // Central pool of available defer structs.
deferlock mutex
- deferpool [5]*_defer
+ deferpool *_defer
// freem is the list of m's waiting to be freed when their
// m.exited is set. Linked through m.freelink.