fix: release builds

This commit is contained in:
dboures 2023-05-07 23:18:01 -05:00
parent f431290284
commit 67c79a1b8f
No known key found for this signature in database
GPG Key ID: AB3790129D478852
1 changed files with 8 additions and 0 deletions

View File

@ -263,6 +263,14 @@ unsafe fn invariant(check: bool) {
}
}
#[cfg(not(debug_assertions))]
#[inline(always)]
unsafe fn invariant(check: bool) {
if check {
std::hint::unreachable_unchecked();
}
}
/// Mainly copied from the original code, slightly modified to make working with it easier.
#[repr(transparent)]
pub struct Slab([u8]);