use a more appropriate type for masked bitmaps

pull/50/head
Daniel Micay 2018-08-25 01:09:15 -04:00
parent f3c8502509
commit f97a0ef8b1
1 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ static uint64_t get_mask(size_t slots) {
} }
static size_t first_free_slot(size_t slots, struct slab_metadata *metadata) { static size_t first_free_slot(size_t slots, struct slab_metadata *metadata) {
size_t masked = metadata->bitmap | get_mask(slots); uint64_t masked = metadata->bitmap | get_mask(slots);
if (masked == ~0UL) { if (masked == ~0UL) {
fatal_error("no zero bits"); fatal_error("no zero bits");
} }
@ -261,7 +261,7 @@ static size_t first_free_slot(size_t slots, struct slab_metadata *metadata) {
} }
static bool has_free_slots(size_t slots, struct slab_metadata *metadata) { static bool has_free_slots(size_t slots, struct slab_metadata *metadata) {
size_t masked = metadata->bitmap | get_mask(slots); uint64_t masked = metadata->bitmap | get_mask(slots);
return masked != ~0UL; return masked != ~0UL;
} }