mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-31 22:45:39 -05:00
GetPool() API
This commit is contained in:
@@ -172,9 +172,11 @@ func (b *Buffer) String() string {
|
||||
return string(b.Bytes())
|
||||
}
|
||||
|
||||
var pool = bytespool.GetPool(Size)
|
||||
|
||||
// New creates a Buffer with 0 length and 2K capacity.
|
||||
func New() *Buffer {
|
||||
return &Buffer{
|
||||
v: bytespool.Alloc(Size),
|
||||
v: pool.Get().([]byte),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user