On Tue, Mar 04 2025, Simon Glass <s...@chromium.org> wrote: > Hi Rasmus, > > On Fri, 18 Oct 2024 at 08:55, Simon Glass <s...@chromium.org> wrote: >> >> Hi Rasmus, >> >> On Fri, 18 Oct 2024 at 01:05, Rasmus Villemoes <r...@prevas.dk> wrote: >> > >> > On tor, okt 17 2024, Simon Glass <s...@chromium.org> wrote: >> > >> > > >> > > membuf: Support a flag for being full >> > > >> > >> > No, that is the worst of all worlds, especially with it being a >> > build-time flag. The right implementation is the one where the head and >> > tail indices are free-running, where you get such a "flag" for >> > free, because you're not wasting the top bits of the indices. >> > >> > https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/ >> >> > >> > If you want to do the churn of renaming anyway, I suggest doing it by >> > adding an implementation using the proper scheme under the new name, >> > switch users over, and dropping the old. IMO, this series as-is brings >> > no value (except for the tests, of course). >> >> OK. Do you think this series gets us closer to that, or further away? > > I didn't get a response to this (which is not a problem, I miss things > all the time). Anyway I don't like the power-of-two restriction and > you can see my other responses above. I've applied this to my tree as > I want to have the tests in place.
I stand by my earlier comments that this is the wrong way to implement a circular buffer. I hope Tom doesn't pull this. Rasmus