summaryrefslogtreecommitdiff
path: root/ewah/ewok.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-12-18 11:25:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-23 18:51:50 (GMT)
commit14fbd260442b14813e142f762050313daee1f18d (patch)
treeefcdf216ff74029203d165b2c405365b06cb09c1 /ewah/ewok.h
parent56d9cbe68b0746640d22b7c05468d76df92debf3 (diff)
downloadgit-14fbd260442b14813e142f762050313daee1f18d.zip
git-14fbd260442b14813e142f762050313daee1f18d.tar.gz
git-14fbd260442b14813e142f762050313daee1f18d.tar.bz2
ewah/bitmap: introduce bitmap_word_alloc()
In a following commit we will need to allocate a variable number of bitmap words, instead of always 32, so let's add bitmap_word_alloc() for this purpose. Note that we have to adjust the block growth in bitmap_set(), since a caller could now use an initial size of "0" (we don't plan to do that, but it doesn't hurt to be defensive). Helped-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ewah/ewok.h')
-rw-r--r--ewah/ewok.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ewah/ewok.h b/ewah/ewok.h
index 84b2a29..1b98b57 100644
--- a/ewah/ewok.h
+++ b/ewah/ewok.h
@@ -172,6 +172,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);
int bitmap_get(struct bitmap *self, size_t pos);
void bitmap_reset(struct bitmap *self);