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 Put ¶
Put returns a buffer to the pool. If pooling is disabled or the buffer is too large, it is discarded.
func SetDiagnostics ¶ added in v0.2.0
SetDiagnostics enables pool diagnostics. When w is non-nil, every Get and Put writes a JSONL entry to w. Pass nil to disable. Safe to call at any time - typically called once at application startup.
func SetMaxPoolSize ¶
SetMaxPoolSize configures the maximum buffer size to keep in pools. Buffers larger than this will be discarded if drop is true, otherwise they will be resized back to maxSize before being pooled.
func SetThreshold ¶ added in v0.1.1
func SetThreshold(size int)
SetThreshold sets the size threshold between small and large pools in bytes
Types ¶
This section is empty.