| 676 | } gm_hops_t; |
| 677 | |
| 678 | static bool gm_hops_push(gm_hops_t *h, uint32_t id, int hop) { |
| 679 | if (h->count == h->cap) { |
| 680 | size_t next = h->cap ? h->cap * GM_GROWTH : GM_SET_MIN_CAP; |
| 681 | cbm_graph_mem_hop_t *rows = |
| 682 | cbm_realloc(CBM_MEM_CLASS_GRAPH_CACHE, h->rows, next * sizeof(cbm_graph_mem_hop_t)); |
| 683 | if (!rows) { |
| 684 | return false; |
| 685 | } |
| 686 | h->rows = rows; |
| 687 | h->cap = next; |
| 688 | } |
| 689 | h->rows[h->count].id = id; |
| 690 | h->rows[h->count].hop = hop; |
| 691 | h->count++; |
| 692 | return true; |
| 693 | } |
| 694 | |
| 695 | static int gm_hop_id_cmp(const void *pa, const void *pb) { |
| 696 | const cbm_graph_mem_hop_t *a = pa; |
no test coverage detected