MCPcopy Index your code
hub / github.com/git/git / rebuild_bitmap

Function rebuild_bitmap

pack-bitmap.c:3085–3114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3083}
3084
3085int rebuild_bitmap(const uint32_t *reposition,
3086 struct ewah_bitmap *source,
3087 struct bitmap *dest)
3088{
3089 uint32_t pos = 0;
3090 struct ewah_iterator it;
3091 eword_t word;
3092
3093 ewah_iterator_init(&it, source);
3094
3095 while (ewah_iterator_next(&word, &it)) {
3096 uint32_t offset, bit_pos;
3097
3098 for (offset = 0; offset < BITS_IN_EWORD; ++offset) {
3099 if ((word >> offset) == 0)
3100 break;
3101
3102 offset += ewah_bit_ctz64(word >> offset);
3103
3104 bit_pos = reposition[pos + offset];
3105 if (bit_pos > 0)
3106 bitmap_set(dest, bit_pos - 1);
3107 else /* can't reuse, we don't have the object */
3108 return -1;
3109 }
3110
3111 pos += BITS_IN_EWORD;
3112 }
3113 return 0;
3114}
3115
3116uint32_t *create_bitmap_mapping(struct bitmap_index *bitmap_git,
3117 struct packing_data *mapping)

Callers 2

fill_bitmap_commitFunction · 0.85

Calls 4

ewah_iterator_initFunction · 0.85
ewah_iterator_nextFunction · 0.85
ewah_bit_ctz64Function · 0.85
bitmap_setFunction · 0.85

Tested by

no test coverage detected