Darkcobra
Member level 3
- Joined
- Nov 20, 2010
- Messages
- 55
- Helped
- 13
- Reputation
- 28
- Reaction score
- 14
- Trophy points
- 1,288
- Activity points
- 1,883
I have a circular (aka ring) buffer. I want to linearize it, so that the contents start at the beginning of the buffer, and can be read in their entirety without the read pointer wrapping.
Is there any algorithm that will do this completely in-place (in the existing buffer), without either making a copy of the original buffer, or allocating any temporary work buffers? (I'm working in a very memory constrained situation.)
Is there any algorithm that will do this completely in-place (in the existing buffer), without either making a copy of the original buffer, or allocating any temporary work buffers? (I'm working in a very memory constrained situation.)