At present the membuf implementation wastes a slot in the fifo so it can detect the difference between a full and an empty buffer.
Add the option of supporting a boolean flag, if desired. For now it is off. The code-size penalty is non-zero, but the space penalty is small and could be reduced on 64-bit machines by using a u32 offset for head and tail. Signed-off-by: Simon Glass <[email protected]> --- include/membuf.h | 6 +++++ lib/membuf.c | 63 ++++++++++++++++++++++++++++++++++++++--------- test/lib/membuf.c | 11 ++++++--- 3 files changed, 65 insertions(+), 15 deletions(-) Applied to sjg/master, thanks!

