Skip to content

Commit 3a94fa4

Browse files
committed
Use local array instead of slice pool inside stack.Trace.
1 parent bfb46b1 commit 3a94fa4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

stack.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ func Trace() CallStack {
224224
sigpanic = findSigpanic()
225225
})
226226

227-
pcs := getUintptrs()
227+
var pcs [512]uintptr
228228

229-
n := runtime.Callers(2, pcs)
229+
n := runtime.Callers(2, pcs[:])
230230
cs := make([]Call, n)
231231

232232
for i, pc := range pcs[:n] {
@@ -240,8 +240,6 @@ func Trace() CallStack {
240240
}
241241
}
242242

243-
putUintptrs(pcs)
244-
245243
return cs
246244
}
247245

0 commit comments

Comments
 (0)