use core::sync::atomic::Ordering;
pub struct NumericRegistry {
next_id: portable_atomic::AtomicUsize,
}
impl NumericRegistry {
pub const fn new() -> Self {
NumericRegistry {
next_id: portable_atomic::AtomicUsize::new(1),
}
}
pub fn allocate_new_id(&self) -> usize {
self.next_id.fetch_add(1, Ordering::SeqCst)
}
}