Uninlined ringbuffer_toread and ringbuffer_towrite