On Thu, May 01, 2025 at 07:37:01AM -0600, Simon Glass wrote: > This construct appears in various places. Reduce code size by adding a > function for it. > > It inits the abuf, then allocates it to the requested size. > > Signed-off-by: Simon Glass <s...@chromium.org> > --- > > Changes in v2: > - Add new patch with a helper for initing and allocating a buffer > > boot/cedit.c | 3 +-- > boot/scene.c | 3 +-- > boot/scene_textline.c | 3 +-- > include/abuf.h | 11 +++++++++++ > lib/abuf.c | 9 +++++++++ > lib/of_live.c | 3 +-- > test/lib/abuf.c | 22 ++++++++++++++++++++++ > 7 files changed, 46 insertions(+), 8 deletions(-)
This just made me look again at the abuf implementation itself and become filled with regret I didn't reject it back in 2021. We're introducing wrappers around standard functions and calling conventions / patterns with something homegrown (and so not intuitive to others) that mainly hides the "sysmem" challenge we also have and I wish you were interested in revisiting how that part of sandbox works instead. And even if this is a better design, for the sake of argument, it's not something everyone else is used to. And that's important. If we *really* need something different / new here, I'd rather see us go and wrap common/dlmalloc.c with kmalloc/kfree/etc and so give people something even more familiar-looking. -- Tom
signature.asc
Description: PGP signature