ck_bitmap: Fix ck_bitmap_init.

Refs #85
ck_pring
Samy Al Bahra 13 years ago
parent 773ceb8257
commit 9d4541d703

@ -88,7 +88,7 @@ ck_bitmap_init(struct ck_bitmap *bitmap,
bitmap->map = buffer; bitmap->map = buffer;
bitmap->length = length; bitmap->length = length;
bitmap->n_buckets = ck_bitmap_size(length) / sizeof(CK_BITMAP_TYPE); bitmap->n_buckets = ck_bitmap_size(length) / sizeof(CK_BITMAP_TYPE);
memset(bitmap->map, -(int)set, length); memset(bitmap->map, -(int)set, ck_bitmap_size(length));
return; return;
} }

@ -98,5 +98,7 @@ main(int argc, char *argv[])
ck_bitmap_init(&bits, buffer, length, true); ck_bitmap_init(&bits, buffer, length, true);
test(&bits, true); test(&bits, true);
ck_bitmap_test(&bits, length - 1);
return 0; return 0;
} }

Loading…
Cancel
Save