implement __seq and __deepSeq

This commit is contained in:
2026-04-26 13:27:54 +08:00
parent d77dcc8929
commit ac76d4a9e4
3 changed files with 222 additions and 3 deletions
+11
View File
@@ -248,6 +248,11 @@ impl<'gc> Value<'gc> {
}
}
#[inline]
pub(crate) fn to_bits(self) -> u64 {
self.raw.to_bits()
}
#[inline]
pub fn as_num(self) -> Option<NixNum> {
if let Some(i) = self.as_inline::<i32>() {
@@ -500,6 +505,12 @@ pub(crate) struct List<'gc> {
}
impl<'gc> List<'gc> {
pub(crate) fn new(mc: &Mutation<'gc>, data: SmallVec<[Value<'gc>; 4]>) -> Gc<'gc, Self> {
Gc::new(mc, Self {
inner: RefLock::new(data)
})
}
pub(crate) fn new_gc(mc: &Mutation<'gc>) -> Gc<'gc, Self> {
Gc::new(mc, Self::default())
}