rodeo/
bumpalo.rs

1//! Re-export of `bumpalo` crate and support for Rodeo.
2
3use core::alloc::Layout;
4use core::ptr::NonNull;
5
6#[doc(no_inline)]
7pub use ::bumpalo::*;
8
9use super::ArenaAlloc;
10
11impl ArenaAlloc for Bump {
12    type Error = AllocErr;
13
14    #[inline]
15    fn try_alloc_layout(&self, layout: Layout) -> Result<NonNull<u8>, Self::Error> {
16        self.try_alloc_layout(layout)
17    }
18}
19
20/// Convenient alias for a bumpalo-back Rodeo.
21pub type Rodeo = crate::Rodeo<Bump>;
22
23#[test]
24fn test_bump() {
25    let bump = Bump::new();
26
27    let _ = bump.alloc(1);
28
29    drop(bump);
30}