Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Debugging with a Circular Buffer (evanjones.ca)
4 points by marcua on May 22, 2010 | hide | past | favorite | 2 comments


Nice, but next time use (counter = (counter + 1) % SIZE) instead of burying an if() statement in a macro.


printf will do a lot more damage than the if.

In my logging system I write the data to the buffer in the natural format (without conversion), preceded by a type-marker. Then I have a tool to unpack the data entries and format them into text.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: