Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscardOversized ¶
func DiscardOversized() bool
DiscardOversized returns whether oversized buffers should be discarded
func Get ¶
Get retrieves a buffer from the pool, sized according to the hint. If pooling is disabled, it returns a new buffer.
func MaxPoolSize ¶
func MaxPoolSize() int
MaxPoolSize returns the maximum buffer size to keep in pools in bytes
func PoolThreshold ¶
func PoolThreshold() int
PoolThreshold returns the size threshold between small and large pools in bytes
func Put ¶
Put returns a buffer to the pool. If pooling is disabled or the buffer is too large, it is discarded.
func SetMaxPoolSize ¶
SetMaxPoolSize configures the maximum buffer size to keep in pools. Buffers larger than this will be discarded if discard is true, otherwise they will be resized back to maxSize before being pooled.
func SetPoolThreshold ¶
func SetPoolThreshold(size int)
SetPoolThreshold sets the size threshold between small and large pools in bytes
Types ¶
This section is empty.