mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-18 12:24:27 -05:00
remove old debugging code
This commit is contained in:
parent
fa2796a941
commit
5e2f03296e
9
malloc.c
9
malloc.c
@ -189,24 +189,15 @@ static struct slab_metadata *alloc_metadata(struct size_class *c, size_t slab_si
|
||||
return metadata;
|
||||
}
|
||||
|
||||
static void check_index(size_t index) {
|
||||
if (index >= 64) {
|
||||
fatal_error("invalid index");
|
||||
}
|
||||
}
|
||||
|
||||
static void set_slot(struct slab_metadata *metadata, size_t index) {
|
||||
check_index(index);
|
||||
metadata->bitmap |= 1UL << index;
|
||||
}
|
||||
|
||||
static void clear_slot(struct slab_metadata *metadata, size_t index) {
|
||||
check_index(index);
|
||||
metadata->bitmap &= ~(1UL << index);
|
||||
}
|
||||
|
||||
static bool get_slot(struct slab_metadata *metadata, size_t index) {
|
||||
check_index(index);
|
||||
return (metadata->bitmap >> index) & 1UL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user