The real problem with modulo is at the end of the integer range. Add one and overflow and suddenly jump to a totally different index in the array!
BTW: read and write pointers, power of two, did that in BeOS (1998) and many sound drivers did it earlier than that.
To me, that seemed like the obvious way to do it when I needed it.
BTW: read and write pointers, power of two, did that in BeOS (1998) and many sound drivers did it earlier than that. To me, that seemed like the obvious way to do it when I needed it.