glbinding
glbinding copied to clipboard
RingBuffer::resize() issues
Looking into Ringbuffer.inl
I noticed that Ringbuffer::resize() simply resizes the internal buffer without any additional checks concerning head and tails. Resizing, especially shrinking a Ringbuffer after it was already used can have results ranging from loss or duplication of entries to crashes due to runtime errors. In short, shrinking a buffer such that the head or the tails are left at invalid (too high) indices should be avoided.
Currently, the RingBuffer is used for logging in glbinding-aux, and resizing this buffer is exposed in logging.h
.