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

Function free_bitmap_index

pack-bitmap.c:3154–3198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3152}
3153
3154void free_bitmap_index(struct bitmap_index *b)
3155{
3156 if (!b)
3157 return;
3158
3159 if (b->map)
3160 munmap(b->map, b->map_size);
3161 ewah_pool_free(b->commits);
3162 ewah_pool_free(b->trees);
3163 ewah_pool_free(b->blobs);
3164 ewah_pool_free(b->tags);
3165 free(b->commits_all);
3166 free(b->trees_all);
3167 free(b->blobs_all);
3168 free(b->tags_all);
3169 if (b->bitmaps) {
3170 struct stored_bitmap *sb;
3171 kh_foreach_value(b->bitmaps, sb, {
3172 ewah_pool_free(sb->root);
3173 free(sb);
3174 });
3175 }
3176 kh_destroy_oid_map(b->bitmaps);
3177 free(b->ext_index.objects);
3178 free(b->ext_index.hashes);
3179 kh_destroy_oid_pos(b->ext_index.positions);
3180 bitmap_free(b->result);
3181 bitmap_free(b->haves);
3182 if (bitmap_is_midx(b)) {
3183 /*
3184 * Multi-pack bitmaps need to have resources associated with
3185 * their on-disk reverse indexes unmapped so that stale .rev and
3186 * .bitmap files can be removed.
3187 *
3188 * Unlike pack-based bitmaps, multi-pack bitmaps can be read and
3189 * written in the same 'git multi-pack-index write --bitmap'
3190 * process. Close resources so they can be removed safely on
3191 * platforms like Windows.
3192 */
3193 close_midx_revindex(b->midx);
3194 }
3195 free_pseudo_merge_map(&b->pseudo_merges);
3196 free_bitmap_index(b->base);
3197 free(b);
3198}
3199
3200int bitmap_has_oid_in_uninteresting(struct bitmap_index *bitmap_git,
3201 const struct object_id *oid)

Callers 15

prepare_bitmap_gitFunction · 0.85
prepare_midx_bitmap_gitFunction · 0.85
prepare_bitmap_walkFunction · 0.85
test_bitmap_walkFunction · 0.85
test_bitmap_commitsFunction · 0.85
test_bitmap_hashesFunction · 0.85
mark_reachable_objectsFunction · 0.85
write_midx_internalFunction · 0.85

Calls 5

ewah_pool_freeFunction · 0.85
bitmap_freeFunction · 0.85
bitmap_is_midxFunction · 0.85
close_midx_revindexFunction · 0.85
free_pseudo_merge_mapFunction · 0.85

Tested by 7

test_bitmap_walkFunction · 0.68
test_bitmap_commitsFunction · 0.68
test_bitmap_hashesFunction · 0.68