MCPcopy
hub / github.com/uber-go/zap / NewPool

Function NewPool

buffer/pool.go:33–41  ·  view source on GitHub ↗

NewPool constructs a new Pool.

()

Source from the content-addressed store, hash-verified

31
32// NewPool constructs a new Pool.
33func NewPool() Pool {
34 return Pool{
35 p: pool.New(func() *Buffer {
36 return &Buffer{
37 bs: make([]byte, 0, _size),
38 }
39 }),
40 }
41}
42
43// Get retrieves a Buffer from the pool, creating one if necessary.
44func (p Pool) Get() *Buffer {

Callers 4

bufferpool.goFile · 0.92
TestBufferWritesFunction · 0.85
BenchmarkBuffersFunction · 0.85
TestBuffersFunction · 0.85

Calls 1

NewFunction · 0.92

Tested by 3

TestBufferWritesFunction · 0.68
BenchmarkBuffersFunction · 0.68
TestBuffersFunction · 0.68