diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2024-05-01 20:33:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-01 18:33:42 +0000 |
| commit | deafcc43829692857d04808a3b9a1c429d73a611 (patch) | |
| tree | 55d99cee5d17c1036d8c6aa544df3adc2bb4c139 /rtic-sync | |
| parent | d9a76b65752d779cbf36a6f43bc36aefbf9a73bf (diff) | |
Make debug asserts into asserts to help find the issue (#931)
Diffstat (limited to 'rtic-sync')
| -rw-r--r-- | rtic-sync/Cargo.toml | 2 | ||||
| -rw-r--r-- | rtic-sync/src/channel.rs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/rtic-sync/Cargo.toml b/rtic-sync/Cargo.toml index 8eb6901..6fcf900 100644 --- a/rtic-sync/Cargo.toml +++ b/rtic-sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rtic-sync" -version = "1.3.0" +version = "1.3.1-alpha.1" edition = "2021" authors = [ diff --git a/rtic-sync/src/channel.rs b/rtic-sync/src/channel.rs index 64d09d1..16cf9f7 100644 --- a/rtic-sync/src/channel.rs +++ b/rtic-sync/src/channel.rs @@ -75,7 +75,7 @@ impl<T, const N: usize> Channel<T, N> { pub fn split(&mut self) -> (Sender<'_, T, N>, Receiver<'_, T, N>) { // Fill free queue for idx in 0..N as u8 { - debug_assert!(!self.freeq.get_mut().is_full()); + assert!(!self.freeq.get_mut().is_full()); // SAFETY: This safe as the loop goes from 0 to the capacity of the underlying queue. unsafe { @@ -83,7 +83,7 @@ impl<T, const N: usize> Channel<T, N> { } } - debug_assert!(self.freeq.get_mut().is_full()); + assert!(self.freeq.get_mut().is_full()); // There is now 1 sender *self.num_senders.get_mut() = 1; @@ -224,7 +224,7 @@ impl<'a, T, const N: usize> Sender<'a, T, N> { // Write the value into the ready queue. critical_section::with(|cs| { - debug_assert!(!self.0.access(cs).readyq.is_full()); + assert!(!self.0.access(cs).readyq.is_full()); unsafe { self.0.access(cs).readyq.push_back_unchecked(idx) } }); @@ -312,7 +312,7 @@ impl<'a, T, const N: usize> Sender<'a, T, N> { } } - debug_assert!(!self.0.access(cs).freeq.is_empty()); + assert!(!self.0.access(cs).freeq.is_empty()); // Get index as the queue is guaranteed not empty and the wait queue is empty let idx = unsafe { self.0.access(cs).freeq.pop_front_unchecked() }; @@ -423,7 +423,7 @@ impl<'a, T, const N: usize> Receiver<'a, T, N> { // Return the index to the free queue after we've read the value. critical_section::with(|cs| { - debug_assert!(!self.0.access(cs).freeq.is_full()); + assert!(!self.0.access(cs).freeq.is_full()); unsafe { self.0.access(cs).freeq.push_back_unchecked(rs) } }); |
