I never use CRT routines in production code because: 1) Less efficient, 2) Possible additional bugs in the CRT layer, 3) Less control over ops than native, and 4) Even when a bug is my fault, it is harder to find with the extra CRT layer of crap on top.https://twitter.com/Jonathan_Blow/status/1417544504916135936 …
-
-
That small set of calls is all you need for a circular buffer that works "automatically" - meaning that you never need to check where you are in the buffer, because the memory is mapped twice, so reading off the end of the buffer just reads the beginning of the buffer.
-
This is all stuff that the CPU does automatically for you, but which people don't realize you can do because of libraries like the CRT which were written for the lowest common denominator (eg., chips with no MMU).
- Show replies
New conversation -
-
-
This was actually a super awesome mechanic that I had no idea about up until now. Thanks for sharing! I've made several ring buffers recently in both job & hobby, and this would make that logic SO much easier & less error prone...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.