Replaced Apple's RingBuffer with a faster, simpler implementation