MCPcopy Create free account
hub / github.com/Windfisch/rust-assert-no-alloc / assert_no_alloc

Function assert_no_alloc

src/lib.rs:44–46  ·  view source on GitHub ↗

if disabled

(func: F)

Source from the content-addressed store, hash-verified

42
43#[cfg(all(feature = "disable_release", not(debug_assertions)))] // if disabled
44pub fn assert_no_alloc<T, F: FnOnce() -> T> (func: F) -> T { // no-op
45 func()
46}
47
48#[cfg(not(all(feature = "disable_release", not(debug_assertions))))] // if not disabled
49/// Calls the `func` closure, but forbids any (de)allocations.

Callers 9

ok_simpleFunction · 0.85
ok_nestedFunction · 0.85
forbidden_simpleFunction · 0.85
forbidden_in_nestedFunction · 0.85
forbidden_after_nestedFunction · 0.85
unwind_okFunction · 0.85
unwind_nestedFunction · 0.85
unwind_nested2Function · 0.85
mainFunction · 0.85

Calls 1

violation_countFunction · 0.85

Tested by 8

ok_simpleFunction · 0.68
ok_nestedFunction · 0.68
forbidden_simpleFunction · 0.68
forbidden_in_nestedFunction · 0.68
forbidden_after_nestedFunction · 0.68
unwind_okFunction · 0.68
unwind_nestedFunction · 0.68
unwind_nested2Function · 0.68