Skip to main content

Module pool

Module pool 

Source
Expand description

Per-loop buffer pool in size classes.

Buffers are plain Vec<u8>s whose capacity is exactly one of the class sizes. BufPool::get hands out an empty buffer of the smallest class that fits; BufPool::put takes it back for reuse, up to a cap per class (beyond that, or for a capacity that is not a class size, the buffer is freed). A pool belongs to one loop thread, so there is no locking.

Structs§

BufPool
A pool of byte buffers in size classes. See the module docs.
PoolStats
Counters of a BufPool.

Constants§

DEFAULT_CLASSES
Default class sizes: 2 KiB, 16 KiB, 64 KiB.