| ▲ | JonChesterfield 6 hours ago | ||||||||||||||||
If it's a power of two, you don't need the branch at all. Let the unsigned index wrap. | |||||||||||||||||
| ▲ | loeg 6 hours ago | parent | next [-] | ||||||||||||||||
You ultimately need a mask to access the correct slot in the ring. But it's true that you can leave unmasked values in your reader/writer indices. | |||||||||||||||||
| ▲ | dalvrosa 6 hours ago | parent | prev [-] | ||||||||||||||||
Interesting, I've never heard about anybody using this. Maybe a bit unreadable? But yeah, should work :) | |||||||||||||||||
| |||||||||||||||||