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

Method mutate

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

Source from the content-addressed store, hash-verified

212 /// but no garbage collection will take place during this method.
213 #[inline]
214 pub fn mutate<F, T>(&self, f: F) -> T
215 where
216 F: for<'gc> FnOnce(&'gc Mutation<'gc>, &'gc Root<'gc, R>) -> T,
217 {
218 unsafe {
219 let mc: &'static Mutation<'_> = &*(self.context.mutation_context() as *const _);
220 let root: &'static Root<'_, R> = &*(&self.root as *const _);
221 f(mc, root)
222 }
223 }
224
225 /// An alternative version of [`Arena::mutate`] which allows mutating the root set, at the
226 /// cost of an extra write barrier.

Callers

nothing calls this directly

Calls 1

mutation_contextMethod · 0.80

Tested by

no test coverage detected