pub mod cache;
pub mod error;
pub mod tw_timer;
pub mod unformat;
pub mod vec;
pub use vec::{Vec, VecRef};
#[doc(hidden)]
pub fn clib_mem_init() {
use std::sync::OnceLock;
static INIT: OnceLock<()> = OnceLock::new();
let _ = INIT.get_or_init(|| {
unsafe {
crate::bindings::clib_mem_init(std::ptr::null_mut(), 3 << 30);
}
});
}
#[cold]
pub const fn cold_path() {}
#[inline(always)]
pub const fn likely(b: bool) -> bool {
if b {
true
} else {
cold_path();
false
}
}
#[inline(always)]
pub const fn unlikely(b: bool) -> bool {
if b {
cold_path();
true
} else {
false
}
}
#[macro_export]
macro_rules! const_assert {
($x:expr $(,)?) => {
const _: [(); 0 - !{
const ASSERT: bool = $x;
ASSERT
} as usize] = [];
};
}