mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-10-01 08:16:00 -04:00
reset buffer when free
This commit is contained in:
parent
5bbece14af
commit
0c213ccd20
@ -47,6 +47,7 @@ func newBytes(size uint32) []byte {
|
|||||||
|
|
||||||
func freeBytes(b []byte) {
|
func freeBytes(b []byte) {
|
||||||
size := uint32(cap(b))
|
size := uint32(cap(b))
|
||||||
|
b = b[0:cap(b)]
|
||||||
for i := numPools - 1; i >= 0; i-- {
|
for i := numPools - 1; i >= 0; i-- {
|
||||||
ps := poolSize[i]
|
ps := poolSize[i]
|
||||||
if size >= ps {
|
if size >= ps {
|
||||||
|
Loading…
Reference in New Issue
Block a user