MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / trace

Method trace

aiscript-vm/src/string/interned.rs:248–262  ·  view source on GitHub ↗
(&self, cc: &Collection)

Source from the content-addressed store, hash-verified

246
247unsafe impl Collect for InternedDynStringsInner<'_> {
248 fn trace(&self, cc: &Collection) {
249 // SAFETY: No new Gc pointers are adopted or reparented.
250 let mut dyn_strings = unsafe { self.0.unlock_unchecked() }.borrow_mut();
251 unsafe {
252 for bucket in dyn_strings.iter() {
253 let s = bucket.as_ref().0;
254 if s.is_dropped(cc) {
255 // SAFETY: it is okay to erase items yielded by the iterator.
256 dyn_strings.erase(bucket);
257 } else {
258 s.trace(cc);
259 }
260 }
261 }
262 }
263}
264
265impl<'gc> InternedDynStrings<'gc> {

Callers

nothing calls this directly

Calls 4

is_droppedMethod · 0.80
borrow_mutMethod · 0.45
as_refMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected