Skip to main content

Crate store_io_buf

Crate store_io_buf 

Source
Expand description

§store-io-buf

Aligned I/O buffers for store-io.

A BufPool maps one page-aligned arena at creation and carves it into power-of-two size classes. BufPool::take pops a free slot from the class’s lock-free free list: no allocation, no lock, no system call, ever blocking. An IoBuf owns its slot exclusively, moves into an I/O and back out in the completion, and returns to its class when dropped.

A pool configured as sensitive wipes every buffer on return (wipe), and locks its arena in RAM and out of core dumps where the OS allows it.

Re-exports§

pub use pool::BufPool;
pub use pool::ClassSpec;
pub use pool::Exhausted;
pub use pool::IoBuf;
pub use pool::PoolConfig;
pub use pool::PoolError;

Modules§

arena
Page-aligned memory for I/O buffers, mapped once and never reallocated.
pool
The buffer pool: fixed size classes carved out of one arena, each with a lock-free free list. Taking a buffer never allocates and never blocks.

Structs§

CachePadded
Aligns and pads T to 128 bytes: two 64-byte lines, because adjacent-line prefetchers on x86-64 and 128-byte lines on Apple silicon otherwise still cause false sharing.
IndexQueue
Bounded MPMC queue of u32 values.
IndexStack
Bounded LIFO stack of u32 values below its capacity.
WaitWord
A 32-bit word threads sleep on until it changes.

Functions§

wipe
Overwrites bytes with zeros in a way the compiler cannot elide.