⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

protect

Function protect 

Source
pub fn protect(ptr: usize, slot: usize) -> HazardGuard
Expand description

Protect a pointer by publishing it in a hazard pointer slot.

Returns a HazardGuard that clears the slot when dropped. The caller must keep the guard alive as long as the pointer is being accessed.

slot must be 0..SLOTS_PER_CPU-1 (per-CPU local slot index).