It turns out that we don't need circular buffer functionality. We replaced RingBuf with simple sequential Buffer.