Skip to content

Commit

Permalink
pack-bitmap.c: WIP filter_bitmap_blob_limit()
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Blau <[email protected]>
  • Loading branch information
ttaylorr committed Aug 14, 2024
1 parent 131a52d commit b207b71
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions pack-bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,18 +1812,19 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
return size;
}

static void filter_bitmap_blob_limit(struct bitmap_index *bitmap_git,
struct object_list *tip_objects,
struct bitmap *to_filter,
unsigned long limit)
static void filter_bitmap_blob_limit_1(struct bitmap_index *bitmap_git,

Check failure on line 1815 in pack-bitmap.c

View workflow job for this annotation

GitHub Actions / fuzz smoke test

pack-bitmap.c:1815:13: function 'filter_bitmap_blob_limit_1' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]

Check failure on line 1815 in pack-bitmap.c

View workflow job for this annotation

GitHub Actions / linux32 (daald/ubuntu32:xenial)

pack-bitmap.c:1815:13: 'filter_bitmap_blob_limit_1' defined but not used [-Werror=unused-function]

Check failure on line 1815 in pack-bitmap.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

pack-bitmap.c:1815:13: 'filter_bitmap_blob_limit_1' defined but not used [-Werror=unused-function]

Check failure on line 1815 in pack-bitmap.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

pack-bitmap.c:1815:13: 'filter_bitmap_blob_limit_1' defined but not used [-Werror=unused-function]
struct bitmap *tips,
struct bitmap *to_filter,
unsigned long limit)
{
struct eindex *eindex = &bitmap_git->ext_index;
struct bitmap *tips;
struct eindex *eindex;
struct ewah_iterator it;
eword_t mask;
uint32_t i;

tips = find_tip_objects(bitmap_git, tip_objects, OBJ_BLOB);
if (bitmap_git->base)
filter_bitmap_blob_limit_1(bitmap_git->base, tips, to_filter,
limit);

for (i = 0, init_type_iterator(&it, bitmap_git, OBJ_BLOB);
i < to_filter->word_alloc && ewah_iterator_next(&mask, &it);
Expand All @@ -1845,14 +1846,24 @@ static void filter_bitmap_blob_limit(struct bitmap_index *bitmap_git,
}
}

for (i = 0; i < eindex->count; i++) {
for (i = 0, eindex = &bitmap_git->ext_index; i < eindex->count; i++) {
size_t pos = st_add(i, bitmap_num_objects(bitmap_git));
if (eindex->objects[i]->type == OBJ_BLOB &&
bitmap_get(to_filter, pos) &&
!bitmap_get(tips, pos) &&
get_size_by_pos(bitmap_git, pos) >= limit)
bitmap_unset(to_filter, pos);
}
}

static void filter_bitmap_blob_limit(struct bitmap_index *bitmap_git,
struct object_list *tip_objects,
struct bitmap *to_filter,
unsigned long limit)
{
struct bitmap *tips;

tips = find_tip_objects(bitmap_git, tip_objects, OBJ_BLOB);

bitmap_free(tips);
}
Expand Down

0 comments on commit b207b71

Please sign in to comment.