use offsets instead of pointers in ringbuf struct; all tests pass