A ring buffer is a mutable array of fixed size. Initially the array is empty, with ringStart pointing at the start of allocated memory. We call the next location to be written in the ring as ringHead. Initially ringHead == ringStart. When the first item is added, ringHead points to ringStart + sizeof item. When the buffer becomes full ringHead would wrap around to ringStart. When the buffer is full, ringHead always points at the oldest item in the ring and the newest item added always overwrites the oldest item.
When using it we should keep in mind that a ringBuffer is a mutable data structure. We should not leak out references to it for immutable use.
Constructors
RingringStart :: !ForeignPtr aringBound :: !Ptr a