* @brief Byte-exact equality of the underlying heap storage. * * Two queues are equal iff they point to the same PriorityQueue OR * they have matching size, item size, and every byte of storage * matches. * * NOTE: this compares STORAGE layout. Two heaps that contain the same * multiset of elements but were built in a different push order can * end up with different layouts and therefore c
| 741 | * @return true if the queues are byte-exact equal. |
| 742 | */ |
| 743 | bool priority_queue_is_equal(const PriorityQueue* a, const PriorityQueue* b) { |
| 744 | PQUEUE_LOG("[priority_queue_is_equal]: enter a=%p b=%p", (const void*)a, (const void*)b); |
| 745 | if (a == b) { |
| 746 | PQUEUE_LOG("[priority_queue_is_equal]: identity (a == b) -> true"); |
| 747 | return true; |
| 748 | } |
| 749 | if (!a || !b || !a->vec || !b->vec) { |
| 750 | PQUEUE_LOG("[priority_queue_is_equal]: one receiver NULL -> false"); |
| 751 | return false; |
| 752 | } |
| 753 | |
| 754 | bool out = vector_is_equal(a->vec, b->vec); |
| 755 | PQUEUE_LOG("[priority_queue_is_equal]: exit -> %s", out ? "true" : "false"); |
| 756 | |
| 757 | return out; |
| 758 | } |
| 759 | |
| 760 | |
| 761 | /** |
no test coverage detected