News for hackers. Stuff that matters.
Re:I've been writing ring buffers wrong all these years by mark-r on Wednesday December 14, 2016 @03:31PM (#13179382)
If you do that then the size() function becomes a problem. The original implementation relies on unsigned integer wrap-around to give the proper result when write < read.
Re:I've been writing ring buffers wrong all these years by caf on Wednesday December 14, 2016 @06:55PM (#13180936)
That is fairly easy to fix, though. Add N to the size value you get until its non-negative.