(&mut self, f: F)
| 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 { |
no test coverage detected