News for hackers. Stuff that matters.
Re:I've been writing ring buffers wrong all these years by tbirdz on Wednesday December 14, 2016 @02:08PM (#13178752)
That's only true if your compiler actually outputs a modulus instruction when it sees you doing N % pow2. It really should optimize that into N & (pow2-1) for you, so whether you write the & or the % it will end up running the cheap & version.

There are no comments on this comment yet.