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

Function NewDirtyBinaryTieredBufferPool

internal/mem/buffer_pool.go:82–86  ·  view source on GitHub ↗

NewDirtyBinaryTieredBufferPool returns a BufferPool backed by multiple sub-pools. It is similar to NewBinaryTieredBufferPool but it does not initialize the buffers before returning them.

(powerOfTwoExponents ...uint8)

Source from the content-addressed store, hash-verified

80// sub-pools. It is similar to NewBinaryTieredBufferPool but it does not
81// initialize the buffers before returning them.
82func NewDirtyBinaryTieredBufferPool(powerOfTwoExponents ...uint8) (*BinaryTieredBufferPool, error) {
83 return newBinaryTiered(func(size int) bufferPool {
84 return newSizedBufferPool(size, false)
85 }, NewDirtySimplePool(), powerOfTwoExponents...)
86}
87
88func newBinaryTiered(sizedPoolFactory func(int) bufferPool, fallbackPool bufferPool, powerOfTwoExponents ...uint8) (*BinaryTieredBufferPool, error) {
89 slices.Sort(powerOfTwoExponents)

Callers 1

TestBufferPool_ClearsMethod · 0.92

Calls 3

newBinaryTieredFunction · 0.85
newSizedBufferPoolFunction · 0.85
NewDirtySimplePoolFunction · 0.85

Tested by 1

TestBufferPool_ClearsMethod · 0.74