#[macro_export]
macro_rules! ic_memory_key {
($stable_key:literal, $label:path, $id:expr) => {{
$crate::memory::runtime::assert_memory_bootstrap_ready(stringify!($label), $id);
$crate::__reexports::ic_memory::ic_memory_key!($stable_key, $label, $id)
}};
}
#[macro_export]
macro_rules! ic_memory_range {
(start = $start:expr, end = $end:expr $(,)?) => {
$crate::__reexports::ic_memory::ic_memory_range!(start = $start, end = $end,);
};
(start = $start:expr, end = $end:expr, mode = $mode:ident $(,)?) => {
$crate::__reexports::ic_memory::ic_memory_range!(start = $start, end = $end, mode = $mode,);
};
}
#[macro_export]
macro_rules! eager_init {
($body:block) => {
$crate::__reexports::ic_memory::eager_init!($body);
};
}
#[macro_export]
macro_rules! eager_static {
($vis:vis static $name:ident : $ty:ty = $init:expr;) => {
thread_local! {
$vis static $name: $ty = $init;
}
const _: () = {
fn __canic_touch_tls() {
$name.with(|_| {});
}
#[ $crate::__reexports::ctor::ctor(unsafe, anonymous, crate_path = $crate::__reexports::ctor) ]
fn __canic_register_eager_tls() {
$crate::memory::runtime::defer_tls_initializer(__canic_touch_tls);
}
};
};
}