mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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 <sjg@chromium.org>
This commit is contained in:
parent
d785a77d18
commit
5bd4ead8bd
3 changed files with 54 additions and 0 deletions
|
@ -274,6 +274,13 @@ bool alist_chk_ptr(const struct alist *lst, const void *ptr);
|
|||
_pos < alist_end(_lst, typeof(*(_pos))); \
|
||||
_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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue