diff options
author | Jeff King <peff@peff.net> | 2020-12-08 17:03:50 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-08 14:48:16 -0800 |
commit | ccae08e822d71aaae1aa2660631d7ded8f4b97e7 (patch) | |
tree | 155cdc54ad64493156d9430ae70086187de6ad15 /ewah/ewok.h | |
parent | ewah: implement bitmap_or() (diff) | |
download | tgif-ccae08e822d71aaae1aa2660631d7ded8f4b97e7.tar.xz |
ewah: add bitmap_dup() function
There's no easy way to make a copy of a bitmap. Obviously a caller can
iterate over the bits and set them one by one in a new bitmap, but we
can go much faster by copying whole words with memcpy().
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ewah/ewok.h')
-rw-r--r-- | ewah/ewok.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ewah/ewok.h b/ewah/ewok.h index 011852bef1..1fc555e672 100644 --- a/ewah/ewok.h +++ b/ewah/ewok.h @@ -173,6 +173,7 @@ struct bitmap { struct bitmap *bitmap_new(void); struct bitmap *bitmap_word_alloc(size_t word_alloc); +struct bitmap *bitmap_dup(const struct bitmap *src); 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); |