MCPcopy
hub / github.com/v2ray/v2ray-core / New

Function New

common/buf/buffer.go:200–204  ·  view source on GitHub ↗

New creates a Buffer with 0 length and 2K capacity.

()

Source from the content-addressed store, hash-verified

198
199// New creates a Buffer with 0 length and 2K capacity.
200func New() *Buffer {
201 return &Buffer{
202 v: pool.Get().([]byte),
203 }
204}
205
206// StackNew creates a new Buffer object on stack.
207// This method is for buffers that is released in the same function.

Callers 15

TestPipeReadWriteFunction · 0.92
TestPipeInterruptFunction · 0.92
TestPipeCloseFunction · 0.92
TestPipeLimitZeroFunction · 0.92
TestPipeWriteMultiThreadFunction · 0.92
BenchmarkPipeReadWriteFunction · 0.92
TestTCPFastOpenFunction · 0.92
TestListenFunction · 0.92
TestListenAbstractFunction · 0.92
TestHTTPConnectionFunction · 0.92
TestQuicConnectionFunction · 0.92

Calls 1

GetMethod · 0.45

Tested by 15

TestPipeReadWriteFunction · 0.74
TestPipeInterruptFunction · 0.74
TestPipeCloseFunction · 0.74
TestPipeLimitZeroFunction · 0.74
TestPipeWriteMultiThreadFunction · 0.74
BenchmarkPipeReadWriteFunction · 0.74
TestTCPFastOpenFunction · 0.74
TestListenFunction · 0.74
TestListenAbstractFunction · 0.74
TestHTTPConnectionFunction · 0.74
TestQuicConnectionFunction · 0.74