// To clear current we need to make sure all private mappings that belong
// to current round are returned to the free list. We can safely ignore
// all shared mappings as they will be garbage collected once their
// respective rounds are cleared
To clear current we need to make sure all private mappings that belong
to current round are returned to the free list. We can safely ignore
all shared mappings as they will be garbage collected once their
respective rounds are cleared
To clear current we need to make sure all private mappings that belong to current round are returned to the free list . We can safely ignore all shared mappings as they will be garbage collected once their respective rounds are cleared
pub fn clear_current(&self) {
        writing(self, "SlotMgr::clear_current", |rw_txn| {
            reading(self, "SlotMgr::clear_current", |ro_txn| {
                let mut ro_cursor = ro_txn.open_ro_cursor(self.current_round_table).unwrap();
                for (_rawk, rawv) in ro_cursor.iter().map(Result::unwrap) {
                    let val = Self::decode_u64(rawv);
                    // add all non shared slots to free list as they wont be required
                    // anymore
                    if !Self::is_shared(val) {
                        rw_txn
                            .put(
                                self.free_list_table,
                                &val.to_le_bytes(),
                                &1_u64.to_le_bytes(),
                                WriteFlags::NO_DUP_DATA,
                            )
                            .expect("copy should succeed");
                    }
                }
            });
            rw_txn.clear_db(self.current_round_table).unwrap();
        })
    }
pub fn clear_current ( & self ) { writing ( self , " " , | rw_txn | { reading ( self , " " , | ro_txn | { let mut ro_cursor = ro_txn . open_ro_cursor ( self . current_round_table ) . unwrap ( ) ; for ( _rawk , rawv ) in ro_cursor . iter ( ) . map ( Result :: unwrap ) { let val = Self :: decode_u64 ( rawv ) ; // add all non shared slots to free list as they wont be required // anymore if ! Self :: is_shared ( val ) { rw_txn . put ( self . free_list_table , & val . to_le_bytes ( ) , & 1_u64 . to_le_bytes ( ) , WriteFlags :: NO_DUP_DATA , ) . expect ( " " ) ; } } } ) ; rw_txn . clear_db ( self . current_round_table ) . unwrap ( ) ; } ) }
To clear current we need to make sure all private mappings that belong
to current round are returned to the free list.
To clear current we need to make sure all private mappings that belong to current round are returned to the free list .
&self