78[[nodiscard]] [[gnu::nonnull(1, 2)]]
92[[nodiscard]] [[gnu::nonnull(1, 2, 3)]]
100[[nodiscard]] [[gnu::nonnull(1)]]
106[[nodiscard]] [[gnu::nonnull(1)]]
113[[gnu::nonnull(1, 2)]]
void pqmh_free(srn_context_t *ctx, pqmh_t *pq)
Release the backing array and reset the queue to empty.
void pqmh_push(srn_context_t *ctx, pqmh_t *pq, void *elem)
Insert elem, growing the backing array (doubling) if it is full.
pqmh_t pqmh_make(srn_context_t *ctx, const pqmh_control_t *ctl, size_t initial_cap)
Create an empty queue ordered by ctl, with room for initial_cap elements (a small default is used whe...
void * pqmh_peek(const pqmh_t *pq)
The highest priority element without removing it, or NULL when the queue is empty.
bool pqmh_pop(srn_context_t *ctx, pqmh_t *pq, void **out)
Remove the highest priority element into *out and return true, or return false (leaving *out untouche...
size_t pqmh_len(const pqmh_t *pq)
The number of elements currently in the queue.
bool(* pqmh_less_fn)(srn_context_t *ctx, const void *a, const void *b)
Strict weak ordering predicate over two elements.
const pqmh_control_t * ctl