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

Method mutate_root

aiscript-arena/src/arena.rs:228–238  ·  view source on GitHub ↗
(&mut self, f: F)

Source from the content-addressed store, hash-verified

226 /// cost of an extra write barrier.
227 #[inline]
228 pub fn mutate_root<F, T>(&mut self, f: F) -> T
229 where
230 F: for<'gc> FnOnce(&'gc Mutation<'gc>, &'gc mut Root<'gc, R>) -> T,
231 {
232 self.context.root_barrier();
233 unsafe {
234 let mc: &'static Mutation<'_> = &*(self.context.mutation_context() as *const _);
235 let root: &'static mut Root<'_, R> = &mut *(&mut self.root as *mut _);
236 f(mc, root)
237 }
238 }
239
240 #[inline]
241 pub fn metrics(&self) -> &Metrics {

Callers 9

init_stdlibMethod · 0.80
compileMethod · 0.80
eval_functionMethod · 0.80
interpretMethod · 0.80
get_globalMethod · 0.80
inject_sso_instanceMethod · 0.80
inject_variablesMethod · 0.80
inject_objectMethod · 0.80

Calls 2

root_barrierMethod · 0.80
mutation_contextMethod · 0.80

Tested by

no test coverage detected