Cythonized RingBuffer.