]> Cypherpunks repositories - gostls13.git/commit
runtime: copy stack before adjusting
authorAustin Clements <austin@google.com>
Tue, 16 Feb 2016 17:23:33 +0000 (12:23 -0500)
committerAustin Clements <austin@google.com>
Mon, 14 Mar 2016 16:29:47 +0000 (16:29 +0000)
commitda153354b2862c1f7e1a55ad98680386d1fe31ef
treee2598abf4e06f01203dec397a82b3cd374ac2a47
parent5a50e003067672ff13bc2ea0464f0cf83a943b2d
runtime: copy stack before adjusting

Currently copystack adjusts pointers in the old stack and then copies
the adjusted stack to the new stack. In addition to being generally
confusing, this is going to make concurrent stack shrinking harder.

Switch this around so that we first copy the stack and then adjust
pointers on the new stack (never writing to the old stack).

This reprises CL 15996, but takes a different and simpler approach. CL
15996 still walked the old stack while adjusting pointers on the new
stack. In this CL, we adjust auxiliary structures before walking the
stack, so we can just walk the new stack.

For #12967.

Change-Id: I94fa86f823ba9ee478e73b2ba509eed3361c43df
Reviewed-on: https://go-review.googlesource.com/20033
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/stack.go