#[derive(Debug, Clone, PartialEq, Eq)]
pub enum GcError {
AllocationFailed,
InvalidReference,
PartitionFull,
PartitionNotFound,
PartitionNotEmpty,
}
pub type GcResult<T> = Result<T, GcError>;
#[inline(always)]
pub(crate) const fn unlikely(expr: bool) -> bool {
if expr {
#[cold]
const fn cold_path() -> bool {
true
}
cold_path()
} else {
false
}
}
#[macro_export]
macro_rules! gc_type_register {
( $( $ty:ty $(, drop_pass = $pass:expr)?; )+ ) => {
$crate::gc_type_table_internal! {
crate_path = $crate;
$( $ty $(, drop_pass = $pass)?; )+
}
};
}