Files
hakorune/src/runtime/observe.rs

22 lines
630 B
Rust
Raw Normal View History

//! Lightweight execution observability flags used by runner policies
//! (e.g., GateC(Core) OOB strict failfast).
use std::sync::atomic::{AtomicBool, Ordering};
static OOB_SEEN: AtomicBool = AtomicBool::new(false);
/// Reset all transient observation flags before a run.
pub fn reset() {
OOB_SEEN.store(false, Ordering::Relaxed);
}
/// Mark that an outofbounds access was observed in the runtime.
pub fn mark_oob() {
OOB_SEEN.store(true, Ordering::Relaxed);
}
/// Returns true if an outofbounds access was observed during the run.
pub fn oob_seen() -> bool {
OOB_SEEN.load(Ordering::Relaxed)
}