devela::_dep::rkyv::util

Function with_arena

pub fn with_arena<T>(f: impl FnOnce(&mut Arena) -> T) -> T
Available on crate feature dep_rkyv only.
Expand description

Calls the given function with the builtin arena allocator.

When the std feature is enabled, the builtin arena allocator is a thread-local variable, with one allocator per thread. When atomic pointers are supported, it is a global static and all threads share the same arena. Otherwise, this will create and drop a new arena each time it is called.