[go: up one dir, main page]

Function rkyv::util::with_arena

source ยท
pub fn with_arena<T>(f: impl FnOnce(&mut Arena) -> T) -> T
Available on crate feature alloc 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.