mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
optimize for 0 buffer size
This commit is contained in:
parent
2bc7347d6d
commit
9ecf89657c
@ -87,7 +87,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
mediumPool *BufferPool
|
mediumPool Pool
|
||||||
smallPool = NewSyncPool(2048)
|
smallPool = NewSyncPool(2048)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -100,6 +100,10 @@ func init() {
|
|||||||
size = uint32(customSize)
|
size = uint32(customSize)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
totalByteSize := size * 1024 * 1024
|
if size > 0 {
|
||||||
mediumPool = NewBufferPool(mediumBufferByteSize, totalByteSize/mediumBufferByteSize)
|
totalByteSize := size * 1024 * 1024
|
||||||
|
mediumPool = NewBufferPool(mediumBufferByteSize, totalByteSize/mediumBufferByteSize)
|
||||||
|
} else {
|
||||||
|
mediumPool = NewSyncPool(mediumBufferByteSize)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user