mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-10-01 01:36:01 -04:00
use a more appropriate type for masked bitmaps
This commit is contained in:
parent
f3c8502509
commit
f97a0ef8b1
4
malloc.c
4
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) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user