MCPcopy Create free account
hub / github.com/git/git / insert_mark

Function insert_mark

builtin/fast-import.c:555–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553}
554
555static 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
579static void *find_mark(struct mark_set *s, uintmax_t idnum)
580{

Callers 5

store_objectFunction · 0.85
stream_blobFunction · 0.85
insert_object_entryFunction · 0.85
insert_oid_entryFunction · 0.85
parse_aliasFunction · 0.85

Calls 1

mem_pool_callocFunction · 0.85

Tested by

no test coverage detected