Ver Fonte

fully allocate buffer pools

v2ray há 9 anos atrás
pai
commit
33e0cfe233
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      common/alloc/buffer_pool.go

+ 1 - 1
common/alloc/buffer_pool.go

@@ -16,7 +16,7 @@ func NewBufferPool(bufferSize, poolSize int) *BufferPool {
 			New: func() interface{} { return make([]byte, bufferSize) },
 		},
 	}
-	for i := 0; i < poolSize/2; i++ {
+	for i := 0; i < poolSize; i++ {
 		pool.chain <- make([]byte, bufferSize)
 	}
 	return pool