aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass2023-08-14 16:40:22 -0600
committerTom Rini2023-08-25 13:54:33 -0400
commit34ecba1f7616b388ee28490e8a3ed43fb1463011 (patch)
treed2c174f76f0afe9055d7e03daefac4b810407424 /lib
parent633b3dc75536a7a878126c41babc248c095b66fe (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')
-rw-r--r--lib/abuf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/abuf.c b/lib/abuf.c
index bd270467dd4..ce2cff53dc9 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;