From f97a0ef8b1dd2442d7dedab4c8a0ece649264084 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 25 Aug 2018 01:09:15 -0400 Subject: [PATCH] use a more appropriate type for masked bitmaps --- malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/malloc.c b/malloc.c index 572e27b..ce0cd5b 100644 --- a/malloc.c +++ b/malloc.c @@ -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) { - size_t masked = metadata->bitmap | get_mask(slots); + uint64_t masked = metadata->bitmap | get_mask(slots); if (masked == ~0UL) { 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) { - size_t masked = metadata->bitmap | get_mask(slots); + uint64_t masked = metadata->bitmap | get_mask(slots); return masked != ~0UL; }