MCPcopy
hub / github.com/grpc/grpc-go / SimpleBufferPool

Struct SimpleBufferPool

internal/mem/buffer_pool.go:304–307  ·  view source on GitHub ↗

SimpleBufferPool is an implementation of the mem.BufferPool interface that attempts to pool buffers with a sync.Pool. When Get is invoked, it tries to acquire a buffer from the pool but if that buffer is too small, it returns it to the pool and creates a new one.

Source from the content-addressed store, hash-verified

302// acquire a buffer from the pool but if that buffer is too small, it returns it
303// to the pool and creates a new one.
304type SimpleBufferPool struct {
305 pool sync.Pool
306 shouldZero bool
307}
308
309// NewDirtySimplePool constructs a [SimpleBufferPool]. It does not initialize
310// the buffers before returning them. Callers must ensure they don't read the

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected