Skip to main content

Module buffer

Module buffer 

Source
Expand description

Fixed buffer pool (IORING_REGISTER_BUFFERS semantics, IO-02).

Every worker pre-allocates CAP slots of BUF_SIZE bytes up front — the request hot path never calls malloc. Slots have stable addresses, which is what allows the io_uring backend to register them with the ring (IORING_REGISTER_BUFFERS) and read with buf_index = slot. The mio backend dereferences the same slots at event time.

Structs§

BufferPool
Pre-allocated, fixed-size buffer pool owned by one worker.

Constants§

DEFAULT_BUF_SIZE
Default per-slot buffer size (single read batch).
DEFAULT_POOL_SIZE
Default slots per worker (power of two, io_uring registration-friendly).