Add an option --pprof

Former-commit-id: 3ca1280e8daddbf1075e3189f9851211ce8882ae
This commit is contained in:
2023-03-28 20:07:26 +07:00
parent 988ae79989
commit e863dc456a
3 changed files with 24 additions and 9 deletions

View File

@@ -45,7 +45,13 @@ func GetSlice(capacity int) []byte {
}
func CopySlice(src []byte) []byte {
sl := GetSlice(len(src))[0:len(src)]
sl := GetSlice(len(src))
if cap(sl) < len(src) {
log.Panicln("Bizarre... j'aurai pourtant cru")
}
sl = sl[0:len(src)]
copy(sl, src)