Some time ago I wrote an array-based ring buffer (queue) in C, and later I added code to change the capacity (resizing it) while keeping elements. Recently I found out that