Skip to main content

Module buffer_pool

Module buffer_pool 

Source
Available on crate feature std only.
Expand description

Pre-allocated Buffer Pool

Recycles I/O buffers to avoid a per-packet heap allocation. A two-level pool: a lock-free global ArrayQueue backed by a per-thread LOCAL_POOL cache, so the hot acquire/return path usually stays thread-local and contention-free, spilling to the global queue only in batches.

Used by the low-level transport::udp_transport socket helper and the buffer_pool_bench. NOTE: the production SessionTransport-level recv path (TcpSessionTransport) uses a persistent BytesMut accumulator instead, so this pool is the alternate / lower-level path rather than the main data plane.

Structs§

BufferPool
A pool of pre-allocated buffers for zero-allocation I/O
PoolStats
Pool statistics
PooledBuffer
A buffer borrowed from the pool

Functions§

global_pool
Get the global buffer pool