fn mark_value(&mut self, value: Value) {
        // The *permission* lives in a live spot, therefore it is live.
        // This also keeps "expired" permissions live.
        self.marks.live_permissions.insert(value.permission);

        let PermissionData::Valid(valid) = &self.machine[value.permission] else {
            tracing::debug!("marking expired permission but skipping object: {:?}", value);
            return;
        };

        if let Leased::Yes = valid.leased {
            // a lease alone isn't enough to keep data alive
            tracing::trace!("skipping leased value: {:?} valid={:?}", value, valid);
            return;
        }

        if !self.marks.live_objects.insert(value.object) {
            // already visited
            tracing::trace!("skipping already visited object: {:?}", value);
            return;
        }

        tracing::debug!("marking value: {:?}", value);
        let object_data: &ObjectData = &self.machine[value.object];
        match object_data {
            ObjectData::Instance(i) => self.mark_values(&i.fields),
            ObjectData::ThunkFn(f) => self.mark_values(&f.arguments),
            ObjectData::ThunkRust(f) => self.mark_values(&f.arguments),
            ObjectData::Tuple(t) => self.mark_values(&t.fields),

            ObjectData::Class(_)
            | ObjectData::Function(_)
            | ObjectData::Intrinsic(_)
            | ObjectData::Bool(_)
            | ObjectData::Uint(_)
            | ObjectData::Int(_)
            | ObjectData::Float(_)
            | ObjectData::String(_)
            | ObjectData::Unit(_) => {
                // no reachable data
            }
        }
    }
/// Marks a value that is reachable from something live (i.e., a root value).
Marks a value that is reachable from something live .
Marks a value that is reachable from something live .
fn mark_value(&mut self, value: Value) {
        // The *permission* lives in a live spot, therefore it is live.
        // This also keeps "expired" permissions live.
        self.marks.live_permissions.insert(value.permission);
        let PermissionData::Valid(valid) = &self.machine[value.permission] else {
            tracing::debug!("marking expired permission but skipping object: {:?}", value);
            return;
        };
        if let Leased::Yes = valid.leased {
            // a lease alone isn't enough to keep data alive
            tracing::trace!("skipping leased value: {:?} valid={:?}", value, valid);
            return;
        }
        if !self.marks.live_objects.insert(value.object) {
            // already visited
            tracing::trace!("skipping already visited object: {:?}", value);
            return;
        }
        tracing::debug!("marking value: {:?}", value);
        let object_data: &ObjectData = &self.machine[value.object];
        match object_data {
            ObjectData::Instance(i) => self.mark_values(&i.fields),
            ObjectData::ThunkFn(f) => self.mark_values(&f.arguments),
            ObjectData::ThunkRust(f) => self.mark_values(&f.arguments),
            ObjectData::Tuple(t) => self.mark_values(&t.fields),
            ObjectData::Class(_)
            | ObjectData::Function(_)
            | ObjectData::Intrinsic(_)
            | ObjectData::Bool(_)
            | ObjectData::Uint(_)
            | ObjectData::Int(_)
            | ObjectData::Float(_)
            | ObjectData::String(_)
            | ObjectData::Unit(_) => {
                // no reachable data
            }
        }
    }
fn mark_value ( & mut self , value : Value ) { // The *permission* lives in a live spot, therefore it is live. // This also keeps "expired" permissions live. self . marks . live_permissions . insert ( value . permission ) ; let PermissionData :: Valid ( valid ) = & self . machine [ value . permission ] else { tracing :: debug ! ( " " value ) ; return ; } ; if let Leased :: Yes = valid . leased { // a lease alone isn't enough to keep data alive tracing :: trace ! ( " " value valid ) ; return ; } if ! self . marks . live_objects . insert ( value . object ) { // already visited tracing :: trace ! ( " " value ) ; return ; } tracing :: debug ! ( " " value ) ; let object_data : & ObjectData = & self . machine [ value . object ] ; match object_data { ObjectData :: Instance ( i ) => self . mark_values ( & i . fields ) , ObjectData :: ThunkFn ( f ) => self . mark_values ( & f . arguments ) , ObjectData :: ThunkRust ( f ) => self . mark_values ( & f . arguments ) , ObjectData :: Tuple ( t ) => self . mark_values ( & t . fields ) , ObjectData :: Class ( _ ) | ObjectData :: Function ( _ ) | ObjectData :: Intrinsic ( _ ) | ObjectData :: Bool ( _ ) | ObjectData :: Uint ( _ ) | ObjectData :: Int ( _ ) | ObjectData :: Float ( _ ) | ObjectData :: String ( _ ) | ObjectData :: Unit ( _ ) => { // no reachable data } } }
Marks a value that is reachable from something live (i.e., a root value).
Marks a value that is reachable from something live ( i . e . a root value ) .
&mut self
value
Value
&mut self
value
Value