mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 13:01:59 +00:00
lib: add missing atomlist_init/fini
Only noticed this when trying to add atomlists to the typesafe datastructure tests... the atomic-specific test_atomlist doesn't use init/fini :/ Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
parent
5cb4277dfe
commit
9680a2af1c
@ -152,6 +152,15 @@ macro_inline type *prefix ## _next_safe(struct prefix##_head *h, type *item) \
|
||||
{ return item ? prefix##_next(h, item) : NULL; } \
|
||||
macro_inline size_t prefix ## _count(struct prefix##_head *h) \
|
||||
{ return atomic_load_explicit(&h->ah.count, memory_order_relaxed); } \
|
||||
macro_inline void prefix ## _init(struct prefix##_head *h) \
|
||||
{ \
|
||||
memset(h, 0, sizeof(*h)); \
|
||||
} \
|
||||
macro_inline void prefix ## _fini(struct prefix##_head *h) \
|
||||
{ \
|
||||
assert(prefix ## _count(h) == 0); \
|
||||
memset(h, 0, sizeof(*h)); \
|
||||
} \
|
||||
/* ... */
|
||||
|
||||
/* add_head:
|
||||
|
Loading…
Reference in New Issue
Block a user