Create a temporary arena without a root object and perform the given operation on it. No garbage collection will be done until the very end of the call, at which point all allocations will be collected. This is a convenience function that makes it a little easier to quickly test code that uses `gc-arena`, it is not very useful on its own.
(f: F)
| 388 | /// This is a convenience function that makes it a little easier to quickly test code that uses |
| 389 | /// `gc-arena`, it is not very useful on its own. |
| 390 | pub fn rootless_mutate<F, R>(f: F) -> R |
| 391 | where |
| 392 | F: for<'gc> FnOnce(&'gc Mutation<'gc>) -> R, |
| 393 | { |
| 394 | unsafe { |
| 395 | let context = Context::new(); |
| 396 | f(context.mutation_context()) |
| 397 | } |
| 398 | } |