aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/stack.go')
-rw-r--r--src/runtime/stack.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index 284c6b3b84..8ae9c1e698 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -852,6 +852,11 @@ func copystack(gp *g, newsize uintptr) {
throw("nil stackbase")
}
used := old.hi - gp.sched.sp
+ // Add just the difference to gcController.addScannableStack.
+ // g0 stacks never move, so this will never account for them.
+ // It's also fine if we have no P, addScannableStack can deal with
+ // that case.
+ gcController.addScannableStack(getg().m.p.ptr(), int64(newsize)-int64(old.hi-old.lo))
// allocate new stack
new := stackalloc(uint32(newsize))