There is a ring buffer version that saves the structure in the ring buffer instead of (the one that you're using where) only pointers are stored.