summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-10-19 09:21:46 -0600
committerSimon Glass <[email protected]>2024-11-02 11:13:59 -0600
commit70f5f17415a257ce8d5f32df5b40194b89a27960 (patch)
treea01d9b96bd88ea76aa1f4e7c253ae02eea12d50d /include
parent83bc5989fc5f71e2c40d75ea786ccbf937b9fbab (diff)
alist: Add a function to empty the list
Sometimes it is useful to empty the list without de-allocating any of the memory used, e.g. when the list will be re-populated immediately afterwards. Add a new function for this. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/alist.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/alist.h b/include/alist.h
index 0090b9c0eb1..c639e42ab7d 100644
--- a/include/alist.h
+++ b/include/alist.h
@@ -275,6 +275,13 @@ bool alist_chk_ptr(const struct alist *lst, const void *ptr);
_pos++)
/**
+ * alist_empty() - Empty an alist
+ *
+ * This removes all entries from the list, without changing the allocated size
+ */
+void alist_empty(struct alist *lst);
+
+/**
* alist_init() - Set up a new object list
*
* Sets up a list of objects, initially empty