jnk0le / Ring-Buffer

simple C++11 ring buffer implementation, allocated and evaluated at compile time
MIT License
374 stars 62 forks source link

Max size of head/tail #25

Open ongkoonhan opened 1 week ago

ongkoonhan commented 1 week ago

I noticed the implementation only increments head/tail atomic size_t variables. If head/tail reaches the max value of size_t and overflows, does the implementation still perform as expected?

jnk0le commented 1 week ago

yes, as the two's complement numbers add/subtract correctly across unsigned overflow.