diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-14 16:40:22 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-25 13:54:33 -0400 |
commit | 34ecba1f7616b388ee28490e8a3ed43fb1463011 (patch) | |
tree | d2c174f76f0afe9055d7e03daefac4b810407424 /lib/abuf.c | |
parent | 633b3dc75536a7a878126c41babc248c095b66fe (diff) |
abuf: Allow incrementing the size
Provide a convenience function to increment the size of the abuf.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/abuf.c')
-rw-r--r-- | lib/abuf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/abuf.c b/lib/abuf.c index bd270467dd..ce2cff53dc 100644 --- a/lib/abuf.c +++ b/lib/abuf.c @@ -82,6 +82,11 @@ bool abuf_realloc(struct abuf *abuf, size_t new_size) } } +bool abuf_realloc_inc(struct abuf *abuf, size_t inc) +{ + return abuf_realloc(abuf, abuf->size + inc); +} + void *abuf_uninit_move(struct abuf *abuf, size_t *sizep) { void *ptr; |