zedshaw / liblcthw

The library you create when you are done with Learn C The Hard Way
http://c.learncodethehardway.org/
Other
359 stars 158 forks source link

RingBuffer isn't really a ring buffer #29

Open tom-huntington opened 5 years ago

tom-huntington commented 5 years ago

A ring buffer should write around the "edge" of the buffer. Zed's RingBuffer merely resets once it is empty.

Consider renaming to FancyBuffer or AdvancedBuffer, or change the implementation to write around the edge.

rreagan3 commented 2 years ago

I should have checked here hours ago - I thought I was crazy or that there was some memcpy magic i didn't understand.