summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bitmap.c7
-rw-r--r--lib/bitmap.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 16bb1464..b6ea5a38 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -27,6 +27,13 @@ bmap_init(struct bmap *b, pool *p, uint size)
}
void
+bmap_reset(struct bmap *b, uint size)
+{
+ b->size = BIRD_ALIGN(size, 4);
+ memset(b->data, 0, b->size);
+}
+
+void
bmap_grow(struct bmap *b, uint need)
{
uint size = b->size * 2;
diff --git a/lib/bitmap.h b/lib/bitmap.h
index df2945a1..0093cd18 100644
--- a/lib/bitmap.h
+++ b/lib/bitmap.h
@@ -17,6 +17,7 @@ struct bmap
};
void bmap_init(struct bmap *b, pool *p, uint size);
+void bmap_reset(struct bmap *b, uint size);
void bmap_grow(struct bmap *b, uint need);
void bmap_free(struct bmap *b);