Forráskód Böngészése

reset buffer when free

Darien Raymond 7 éve
szülő
commit
0c213ccd20
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      common/buf/buffer_pool.go

+ 1 - 0
common/buf/buffer_pool.go

@@ -47,6 +47,7 @@ func newBytes(size uint32) []byte {
 
 func freeBytes(b []byte) {
 	size := uint32(cap(b))
+	b = b[0:cap(b)]
 	for i := numPools - 1; i >= 0; i-- {
 		ps := poolSize[i]
 		if size >= ps {