MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / priority_queue_capacity

Function priority_queue_capacity

priority_queue/priority_queue.c:416–427  ·  view source on GitHub ↗

* @brief Allocated capacity of the underlying vector. * * Capacity ≥ size; the queue can absorb (capacity − size) more pushes * without re-allocating. * * @param pq Queue pointer. NULL returns 0. * @return Capacity in elements. */

Source from the content-addressed store, hash-verified

414 * without re-allocating.
415 *
416 * @param pq Queue pointer. NULL returns 0.
417 * @return Capacity in elements.
418 */
419size_t priority_queue_capacity(const PriorityQueue* pq) {
420 PQUEUE_LOG("[priority_queue_capacity]: enter pq=%p", (const void*)pq);
421
422 if (!pq || !pq->vec) {
423 PQUEUE_LOG("[priority_queue_capacity]: NULL receiver -> 0");
424 return 0;
425 }
426 size_t out = vector_capacity((Vector*)pq->vec);
427 PQUEUE_LOG("[priority_queue_capacity]: exit -> %zu", out);
428
429 return out;
430}

Callers

nothing calls this directly

Calls 1

vector_capacityFunction · 0.85

Tested by

no test coverage detected