mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 00:00:08 +01:00
NMPrioq is taken from systemd's "prioq.c". It is a nice data structure,
that accepts and an index pointer, to directly access elements inside
the heap.
Previously, the API didn't require a consistent index, while the data is
not inside the heap. nm_prioq_{update,shuffle,remove}()) call find_item(),
which silently accepts wrong indexes and assumes the element is not in
the heap.
Keeping the index in sync with the data seems error prone. Accepting any
index without asserting may be convenient for the user (as the user is
not required to pre-initialize the index with NM_PRIOQ_IDX_NULL).
However, it also misses to catch potential bugs.
Now the index must be kept consistent, in particular also if the element
is not enqueued. This means, you must initialize them with
NM_PRIOQ_IDX_NULL.
|
||
|---|---|---|
| .. | ||
| meson.build | ||
| nm-lldp-neighbor.c | ||
| nm-lldp-neighbor.h | ||
| nm-lldp-network.c | ||
| nm-lldp-network.h | ||
| nm-lldp-rx-internal.h | ||
| nm-lldp-rx.c | ||
| nm-lldp-rx.h | ||
| nm-lldp.h | ||