Skip to main content

luaur_vm/macros/
checkliveness.rs

1use crate::iscollectable;
2use crate::isdead;
3use crate::ttype;
4use luaur_common::LUAU_ASSERT;
5
6#[allow(non_snake_case)]
7#[macro_export]
8macro_rules! checkliveness {
9    ($g:expr, $obj:expr) => {
10        luaur_common::LUAU_ASSERT!(
11            !$crate::iscollectable!($obj)
12                || (($crate::ttype!($obj) == (*(*$obj).value.gc).gch.tt as core::ffi::c_int)
13                    && !$crate::isdead!($g, (*$obj).value.gc))
14        )
15    };
16}
17
18pub use checkliveness;