Skip to main content

Crate alloc_once_macros

Crate alloc_once_macros 

Source
Expand description

Procedural macro backing alloc_once!.

alloc_once!(v1, v2, ...) packs the values into a single tuple, allocates that tuple once inside a freshly created bump arena, and returns an alloc_once::AllocOnce guard that owns the arena. All bumpalo details are hidden: the expansion only names paths under ::alloc_once, so callers do not need a bumpalo dependency of their own.

Macrosยง

alloc_once
Allocate several (possibly different-typed) values in a single bump allocation and return a guard that owns the backing arena.