mirror of https://github.com/v2ray/v2ray-core
leverage local buffer
parent
7e499ee0b6
commit
1931820c4c
|
@ -36,7 +36,7 @@ func (this *BufferedSegmentWriter) Write(seg Segment) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if this.buffer == nil {
|
if this.buffer == nil {
|
||||||
this.buffer = alloc.NewSmallBuffer().Clear()
|
this.buffer = alloc.NewLocalBuffer(2048).Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.buffer.Value = seg.Bytes(this.buffer.Value)
|
this.buffer.Value = seg.Bytes(this.buffer.Value)
|
||||||
|
|
Loading…
Reference in New Issue