[PATCH 0/8] membuff: Add tests and update to support a flag for empty/full

Rasmus Villemoes ravi at prevas.dk
Fri Oct 18 09:05:21 CEST 2024


On tor, okt 17 2024, Simon Glass <sjg at 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).

Rasmus


More information about the U-Boot mailing list