diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-02 15:07:18 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-02 15:07:18 -0800 |
commit | 0df82d99dae85dbd4f667e95020a146ea0167975 (patch) | |
tree | b5af782c64f9515ca57938b5bbb1414bc9e14ead /ewah | |
parent | Merge branch 'jk/push-option-doc-markup-fix' (diff) | |
parent | rev-list --count: comment on the use of count_right++ (diff) | |
download | tgif-0df82d99dae85dbd4f667e95020a146ea0167975.tar.xz |
Merge branch 'jk/object-filter-with-bitmap'
The object reachability bitmap machinery and the partial cloning
machinery were not prepared to work well together, because some
object-filtering criteria that partial clones use inherently rely
on object traversal, but the bitmap machinery is an optimization
to bypass that object traversal. There however are some cases
where they can work together, and they were taught about them.
* jk/object-filter-with-bitmap:
rev-list --count: comment on the use of count_right++
pack-objects: support filters with bitmaps
pack-bitmap: implement BLOB_LIMIT filtering
pack-bitmap: implement BLOB_NONE filtering
bitmap: add bitmap_unset() function
rev-list: use bitmap filters for traversal
pack-bitmap: basic noop bitmap filter infrastructure
rev-list: allow commit-only bitmap traversals
t5310: factor out bitmap traversal comparison
rev-list: allow bitmaps when counting objects
rev-list: make --count work with --objects
rev-list: factor out bitmap-optimized routines
pack-bitmap: refuse to do a bitmap traversal with pathspecs
rev-list: fallback to non-bitmap traversal when filtering
pack-bitmap: fix leak of haves/wants object lists
pack-bitmap: factor out type iterator initialization
Diffstat (limited to 'ewah')
-rw-r--r-- | ewah/bitmap.c | 8 | ||||
-rw-r--r-- | ewah/ewok.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ewah/bitmap.c b/ewah/bitmap.c index b5fed9621f..d8cec585af 100644 --- a/ewah/bitmap.c +++ b/ewah/bitmap.c @@ -50,6 +50,14 @@ void bitmap_set(struct bitmap *self, size_t pos) self->words[block] |= EWAH_MASK(pos); } +void bitmap_unset(struct bitmap *self, size_t pos) +{ + size_t block = EWAH_BLOCK(pos); + + if (block < self->word_alloc) + self->words[block] &= ~EWAH_MASK(pos); +} + int bitmap_get(struct bitmap *self, size_t pos) { size_t block = EWAH_BLOCK(pos); diff --git a/ewah/ewok.h b/ewah/ewok.h index 1b98b57c8b..011852bef1 100644 --- a/ewah/ewok.h +++ b/ewah/ewok.h @@ -174,6 +174,7 @@ struct bitmap { struct bitmap *bitmap_new(void); struct bitmap *bitmap_word_alloc(size_t word_alloc); void bitmap_set(struct bitmap *self, size_t pos); +void bitmap_unset(struct bitmap *self, size_t pos); int bitmap_get(struct bitmap *self, size_t pos); void bitmap_reset(struct bitmap *self); void bitmap_free(struct bitmap *self); |