feat: Waku v2 bridge

Issue #12610
This commit is contained in:
Michal Iskierko
2023-11-12 13:29:38 +01:00
parent 56e7bd01ca
commit 6d31343205
6716 changed files with 1982502 additions and 5891 deletions

39
vendor/github.com/anacrolix/missinggo/perf/scope.go generated vendored Normal file
View File

@@ -0,0 +1,39 @@
package perf
import (
"runtime"
)
func ScopeTimer(opts ...timerOpt) func() {
t := NewTimer(CallerName(1))
return func() { t.Mark("returned") }
}
func ScopeTimerOk(ok *bool) func() {
t := NewTimer(CallerName(1))
return func() { t.MarkOk(*ok) }
}
func ScopeTimerErr(err *error) func() {
t := NewTimer(CallerName(1))
return func() {
r := recover()
if r != nil {
t.Mark("panic")
panic(r)
}
t.MarkErr(*err)
}
}
func CallerName(skip int) timerOpt {
return Name(getCallerName(skip))
}
func getCallerName(skip int) string {
var pc [1]uintptr
runtime.Callers(3+skip, pc[:])
fs := runtime.CallersFrames(pc[:])
f, _ := fs.Next()
return f.Func.Name()
}