nemo_rl.data_plane.nixl.allocator#

First-fit slab allocator with aligned allocations and timed quarantine.

Blobs are immutable and freed whole, so the allocator only needs alloc(nbytes) and free(off, nbytes). A freed region may still be the target of an in-flight one-sided read, so callers place it in quarantine with a release time instead of freeing it outright; reclaim(now) moves expired regions back to the free list.

Module Contents#

Classes#

Functions#

API#

nemo_rl.data_plane.nixl.allocator.align_up(n: int, align: int) → int#
class nemo_rl.data_plane.nixl.allocator._Range#
off: int#

None

size: int#

None

class nemo_rl.data_plane.nixl.allocator.SlabAllocator(
capacity: int,
align: int = 64,
on_free: Callable[[int, int], None] | None = None,
)#

Initialization

alloc(nbytes: int) → int#
free(off: int, nbytes: int) → None#
quarantine(off: int, nbytes: int, release_at: float) → None#

Defer free until release_at (monotonic seconds).

reclaim(now: float) → int#

Free every quarantined region whose release time has passed.

property free_bytes: int#
property quarantined_bytes: int#
property largest_free: int#
property fragments: int#