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.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index 6679cd993d..6d24814271 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -415,6 +415,13 @@ func stackalloc(n uint32) stack {
v = unsafe.Pointer(s.base())
}
+ if traceAllocFreeEnabled() {
+ trace := traceAcquire()
+ if trace.ok() {
+ trace.GoroutineStackAlloc(uintptr(v), uintptr(n))
+ traceRelease(trace)
+ }
+ }
if raceenabled {
racemalloc(v, uintptr(n))
}
@@ -458,6 +465,13 @@ func stackfree(stk stack) {
}
return
}
+ if traceAllocFreeEnabled() {
+ trace := traceAcquire()
+ if trace.ok() {
+ trace.GoroutineStackFree(uintptr(v))
+ traceRelease(trace)
+ }
+ }
if msanenabled {
msanfree(v, n)
}