Skip to main content

Module buffer_pool

Module buffer_pool 

Source
Expand description

Buffer pool for reusable byte buffers organized by size class.

The buffer pool eliminates frequent heap allocations by maintaining free lists of pre-allocated buffers. When a PooledBuffer is dropped it is automatically returned to the pool for future reuse.

§Size classes

Buffers are grouped into nine size classes (in bytes): 4 KB, 8 KB, 16 KB, 32 KB, 64 KB, 128 KB, 256 KB, 512 KB, 1 MB.

Structs§

BufferPool
A pool of reusable byte buffers organized by size class.
BufferPoolStats
Snapshot of BufferPool counters.
PooledBuffer
A byte buffer borrowed from a BufferPool.