1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-04 16:25:21 -05:00

refine buffer struct

This commit is contained in:
v2ray
2016-07-15 14:24:20 +02:00
parent 631db6e69a
commit 9523cb3ec3
2 changed files with 12 additions and 8 deletions

View File

@@ -29,12 +29,7 @@ func (p *BufferPool) Allocate() *Buffer {
default:
b = p.allocator.Get().([]byte)
}
return &Buffer{
head: b,
pool: p,
Value: b[defaultOffset:],
offset: defaultOffset,
}
return CreateBuffer(b, p)
}
func (p *BufferPool) Free(buffer *Buffer) {