Skip to main content

REFCOUNT_UNUSED

Constant REFCOUNT_UNUSED 

Source
pub const REFCOUNT_UNUSED: u32 = u32::MAX; // 4_294_967_295u32
Expand description

Sentinel refcount for a frame that is in the buddy free list.

Mirrors REF_COUNT_UNUSED in Asterinas OSTD meta.rs.

buddy.rs stamps this value in mark_block_free() and leaves it intact in mark_block_allocated(). FrameAllocOptions::allocate() performs CAS(REFCOUNT_UNUSED -> 1) to atomically claim the frame and detect any double-free / free-list corruption.