adjustments on capabilities on cartridges

This commit is contained in:
2026-03-24 13:40:44 +00:00
parent cfdca93160
commit d5ef8a2003
19 changed files with 1570 additions and 205 deletions
+10 -4
View File
@@ -51,7 +51,8 @@
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub enum ObjectKind {
/// Reserved/unknown kind. Should not appear in valid allocations.
#[allow(dead_code)] // Kept for stable tag layout and persisted images, even if not constructed in this crate yet
#[allow(dead_code)]
// Kept for stable tag layout and persisted images, even if not constructed in this crate yet
Unknown = 0,
/// UTF-8 string. `payload_len` is the number of bytes.
@@ -87,7 +88,6 @@ pub enum ObjectKind {
/// contained `HeapRef`s directly.
/// - `payload_len` is 0 for this fixed-layout object.
Coroutine = 6,
// Future kinds must be appended here to keep tag numbers stable.
}
@@ -120,10 +120,16 @@ impl ObjectHeader {
}
/// Returns true if the GC mark bit is set.
pub fn is_marked(&self) -> bool { (self.flags & object_flags::MARKED) != 0 }
pub fn is_marked(&self) -> bool {
(self.flags & object_flags::MARKED) != 0
}
/// Sets or clears the GC mark bit. Note: actual GC logic lives elsewhere.
pub fn set_marked(&mut self, value: bool) {
if value { self.flags |= object_flags::MARKED; } else { self.flags &= !object_flags::MARKED; }
if value {
self.flags |= object_flags::MARKED;
} else {
self.flags &= !object_flags::MARKED;
}
}
}