Documentation
¶
Overview ¶
Package buffer provides a pooled *[]byte for zero-alloc formatting in hot paths. Consumers acquire a reusable buffer via Get and return it via Put so steady-state allocations tend toward zero. It is a thin byte-slice specialisation over internal/kernel/concur/recycler.CappedPool (ADR 0010): the recycling mechanism lives in recycler, the 64-KiB capacity threshold and the *[]byte type live here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get() *[]byte
Get borrows a reusable byte buffer with zero length and capacity >= initialCap.
func Put ¶
func Put(b *[]byte)
Put returns a buffer to the pool after use; the recycler truncates its length and drops it when cap exceeds maxRetain. A nil argument is a safe no-op so call sites can always defer Put — the generic CappedPool cannot nil-check a pointer-like T, so the guard lives here.
Types ¶
This section is empty.