| 553 | } |
| 554 | |
| 555 | static void insert_mark(struct mark_set **top, uintmax_t idnum, struct object_entry *oe) |
| 556 | { |
| 557 | struct mark_set *s = *top; |
| 558 | |
| 559 | while ((idnum >> s->shift) >= 1024) { |
| 560 | s = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct mark_set)); |
| 561 | s->shift = (*top)->shift + 10; |
| 562 | s->data.sets[0] = *top; |
| 563 | *top = s; |
| 564 | } |
| 565 | while (s->shift) { |
| 566 | uintmax_t i = idnum >> s->shift; |
| 567 | idnum -= i << s->shift; |
| 568 | if (!s->data.sets[i]) { |
| 569 | s->data.sets[i] = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct mark_set)); |
| 570 | s->data.sets[i]->shift = s->shift - 10; |
| 571 | } |
| 572 | s = s->data.sets[i]; |
| 573 | } |
| 574 | if (!s->data.marked[idnum]) |
| 575 | marks_set_count++; |
| 576 | s->data.marked[idnum] = oe; |
| 577 | } |
| 578 | |
| 579 | static void *find_mark(struct mark_set *s, uintmax_t idnum) |
| 580 | { |
no test coverage detected