Feb. 22, 2007
7:29 a.m.
On 2/21/2007 11:03 PM, Anne Archibald wrote:
I think it is almost as efficient as memmove; in particular, it doesn't create any temporaries
A ring buffer is O(1) whereas a memmove is O(N). Unless the amount of data to be moved are very small, this makes the ringbuffer the more attractive solution. Slicing becomes a little bit more complicated with a ring, but not very much. The data are stored in two ordered and contiguous segments: after and before the stack pointer (in that order). Sturla Molden