Merging upstream version 4.3+20241108.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
1e24552bfc
commit
60ccb5b596
64 changed files with 2015 additions and 1768 deletions
15
dlink.c
15
dlink.c
|
@ -26,6 +26,21 @@ void dl_free(void *v)
|
|||
free(vv-1);
|
||||
}
|
||||
|
||||
void dl_free_all(void *head)
|
||||
{
|
||||
/* The list head is linked with the list tail so in order to free
|
||||
* all the elements properly there is a need to keep starting point.
|
||||
*/
|
||||
void *d = dl_next(head), *next;
|
||||
|
||||
while (d != head) {
|
||||
next = dl_next(d);
|
||||
dl_free(d);
|
||||
d = next;
|
||||
}
|
||||
dl_free(head);
|
||||
}
|
||||
|
||||
void dl_init(void *v)
|
||||
{
|
||||
dl_next(v) = v;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue