]> Cypherpunks repositories - gostls13.git/commit
runtime: separate stack freeing from stack shrinking
authorAustin Clements <austin@google.com>
Wed, 3 Apr 2019 18:47:55 +0000 (14:47 -0400)
committerAustin Clements <austin@google.com>
Fri, 5 Apr 2019 20:19:59 +0000 (20:19 +0000)
commit68d89bb8e05afc2aa050b4c5ad0df4b3af03c45d
tree60f595a8e96eb449910f083c6a5e2aa67dcd4dce
parentea9859f858b603cbf49f0a930f83c56a716490a4
runtime: separate stack freeing from stack shrinking

Currently, shrinkstack will free the stack if the goroutine is dead.
There are only two places that call shrinkstack: scanstack, which will
never call it if the goroutine is dead; and markrootFreeGStacks, which
only calls it on dead goroutines.

Clean this up by separating stack freeing out of shrinkstack.

Change-Id: I7d7891e620550c32a2220833923a025704986681
Reviewed-on: https://go-review.googlesource.com/c/go/+/170890
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/mgcmark.go
src/runtime/stack.go