bump-scope 2.3.0

A fast bump allocator that supports allocation scopes / checkpoints. Aka an arena for values of arbitrary types.
Documentation
1
2
3
4
5
6
7
8
use core::{alloc::Layout, num::NonZeroUsize, ptr::NonNull};

/// See [`std::alloc::Layout::dangling`].
#[inline]
#[must_use]
pub(crate) const fn dangling(layout: Layout) -> NonNull<u8> {
    unsafe { super::non_null::without_provenance(NonZeroUsize::new_unchecked(layout.align())) }
}