3 ms·
So the bounds check is: queue.bufs_in_use[rx_index] If so the bounds check could possibly be safely eliminated by the programmer because I think `wrap_rin
by ChrisSD 7y ago
So the bounds check is:
queue.bufs_in_use[rx_index]
If so the bounds check could possibly be safely eliminated by the programmer because I think `wrap_ring` ensures that rx_index will always be in bounds?
- GrayShade 7y agoYes. It wouldn't be too unidiomatic to use get_unchecked in those two places, perhaps with a debug_assert! in place. It would be really nice if this wasn't needed, but it's a valid use of unsafe code.