优化byte内存池

This commit is contained in:
bjdgyc
2021-07-19 12:30:20 +08:00
parent ea4dda0fca
commit 8ff77626d0
5 changed files with 29 additions and 23 deletions

View File

@@ -102,7 +102,8 @@ func tunRead(ifce *water.Interface, cSess *sessdata.ConnSession) {
for {
// data := make([]byte, BufferSize)
data := getByteFull()
hb := getByteFull()
data := *hb
n, err = ifce.Read(data)
if err != nil {
base.Error("tun Read err", n, err)
@@ -121,6 +122,6 @@ func tunRead(ifce *water.Interface, cSess *sessdata.ConnSession) {
return
}
putByte(data)
putByte(hb)
}
}