Replace assert! with debug_assert! in production code paths.
This allows the assertions to be disabled in release builds, so that the code is faster and smaller, at the expense of not performing the checks. Assertions can be re-enabled in release builds with the debug-assertions flag in Cargo.toml, as the top-level Cargo.toml file does.
This commit is contained in:
@@ -1026,7 +1026,7 @@ fn get_heap_addr(
|
||||
use std::cmp::min;
|
||||
|
||||
let guard_size: i64 = builder.func.heaps[heap].guard_size.into();
|
||||
assert!(guard_size > 0, "Heap guard pages currently required");
|
||||
debug_assert!(guard_size > 0, "Heap guard pages currently required");
|
||||
|
||||
// Generate `heap_addr` instructions that are friendly to CSE by checking offsets that are
|
||||
// multiples of the guard size. Add one to make sure that we check the pointer itself is in
|
||||
|
||||
Reference in New Issue
Block a user