package mem

Import Path
	google.golang.org/grpc/internal/mem (on go.dev)

Dependency Relation
	imports 5 packages, and imported by 2 packages

Involved Source Files Package mem provides utilities that facilitate memory reuse in byte slices that are used as buffers.
Package-Level Type Names (total 6, in which 4 are exported)
/* sort exporteds by: | */
BinaryTieredBufferPool is a buffer pool that uses multiple sub-pools with power-of-two sizes. Get returns a buffer with specified length from the pool. Put returns a buffer to the pool. *BinaryTieredBufferPool : google.golang.org/grpc/mem.BufferPool func NewBinaryTieredBufferPool(powerOfTwoExponents ...uint8) (*BinaryTieredBufferPool, error) func NewDirtyBinaryTieredBufferPool(powerOfTwoExponents ...uint8) (*BinaryTieredBufferPool, error)
NopBufferPool is a buffer pool that returns new buffers without pooling. Get returns a buffer with specified length from the pool. Put returns a buffer to the pool. NopBufferPool : google.golang.org/grpc/mem.BufferPool
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. Get returns a buffer with specified length from the pool. Put returns a buffer to the pool. *SimpleBufferPool : google.golang.org/grpc/mem.BufferPool func NewDirtySimplePool() *SimpleBufferPool
TieredBufferPool implements the BufferPool interface with multiple tiers of buffer pools for different sizes of buffers. Get returns a buffer with specified length from the pool. Put returns a buffer to the pool. *TieredBufferPool : google.golang.org/grpc/mem.BufferPool func NewTieredBufferPool(poolSizes ...int) *TieredBufferPool
Package-Level Functions (total 6, in which 4 are exported)
NewBinaryTieredBufferPool returns a BufferPool backed by multiple sub-pools. This structure enables O(1) lookup time for Get and Put operations. The arguments provided are the exponents for the buffer capacities (powers of 2), not the raw byte sizes. For example, to create a pool of 16KB buffers (2^14 bytes), pass 14 as the argument.
NewDirtyBinaryTieredBufferPool returns a BufferPool backed by multiple sub-pools. It is similar to NewBinaryTieredBufferPool but it does not initialize the buffers before returning them.
NewDirtySimplePool constructs a [SimpleBufferPool]. It does not initialize the buffers before returning them. Callers must ensure they don't read the buffers before writing data to them.
NewTieredBufferPool returns a BufferPool implementation that uses multiple underlying pools of the given pool sizes.
Package-Level Variables (only one, which is unexported)
Package-Level Constants (only one, which is unexported)