MCPcopy Create free account
hub / github.com/djherbis/buffer / NewMemPoolAt

Function NewMemPoolAt

pool_at.go:54–61  ·  view source on GitHub ↗

NewMemPoolAt returns a PoolAt, Get() returns an in memory buffer of max size N. Put() returns the buffer to the pool after resetting it. Get() and Put() errors will always be nil.

(N int64)

Source from the content-addressed store, hash-verified

52// Put() returns the buffer to the pool after resetting it.
53// Get() and Put() errors will always be nil.
54func NewMemPoolAt(N int64) PoolAt {
55 return &memPoolAt{
56 N: N,
57 PoolAt: NewPoolAt(func() BufferAt {
58 return New(N)
59 }),
60 }
61}
62
63func (m *memPoolAt) MarshalBinary() ([]byte, error) {
64 buf := bytes.NewBuffer(nil)

Callers 5

TestWriteAtFunction · 0.85
TestMemPoolAtFunction · 0.85
TestPartitionAtFunction · 0.85
TestPartitionAt2Function · 0.85
TestPartitionAt3Function · 0.85

Calls 2

NewPoolAtFunction · 0.85
NewFunction · 0.85

Tested by 5

TestWriteAtFunction · 0.68
TestMemPoolAtFunction · 0.68
TestPartitionAtFunction · 0.68
TestPartitionAt2Function · 0.68
TestPartitionAt3Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…