Re:I've been writing ring buffers wrong all these years (2016)
by fullstop on Thursday December 18, 2025 @11:39PM
(#46322323)
I've used the "Waste an element" one for ages on microcontrollers where I don't want to deal with the overhead in an ISR.
[ Parent
| on HN ]
Re:I've been writing ring buffers wrong all these years (2016)
by zephen on Friday December 19, 2025 @01:17AM
(#46322770)
Agreed.
The article author claims that the "don't waste an element" code is also more efficient, but that claim seems to be based on a hard-on about the post-increment operator, rather than any kind of dive into the cyclometric complexity, or even, y'know, just looking at the assembler output from the compiler.