pub struct AllocDisabler;Expand description
The custom allocator that handles the checking.
To use this crate, you must add the following in your main.rs:
use nice_assert_no_alloc::*;
// ...
#[cfg(debug_assertions)]
#[global_allocator]
static A: AllocDisabler = AllocDisabler;Trait Implementations§
Source§impl GlobalAlloc for AllocDisabler
Available on not (crate feature disable_release and non-debug-assertions enabled).
impl GlobalAlloc for AllocDisabler
Available on not (crate feature
disable_release and non-debug-assertions enabled).Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreAuto Trait Implementations§
impl Freeze for AllocDisabler
impl RefUnwindSafe for AllocDisabler
impl Send for AllocDisabler
impl Sync for AllocDisabler
impl Unpin for AllocDisabler
impl UnsafeUnpin for AllocDisabler
impl UnwindSafe for AllocDisabler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more