Function assert_allocs

Source
pub fn assert_allocs(f: impl FnOnce())
Expand description

Records the allocations within a code block and asserts that no issues were detected.

No checks are performed if miri is detected, as we cannot collect allocation data in that case, and miri performs many of these checks already.

If the tracing feature is enabled and an error or leak is detected, this function also prints out the full trace to stderr.