remove old debugging code
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;
|
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) {
|
static void set_slot(struct slab_metadata *metadata, size_t index) {
|
||||||
check_index(index);
|
|
||||||
metadata->bitmap |= 1UL << index;
|
metadata->bitmap |= 1UL << index;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clear_slot(struct slab_metadata *metadata, size_t index) {
|
static void clear_slot(struct slab_metadata *metadata, size_t index) {
|
||||||
check_index(index);
|
|
||||||
metadata->bitmap &= ~(1UL << index);
|
metadata->bitmap &= ~(1UL << index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool get_slot(struct slab_metadata *metadata, size_t index) {
|
static bool get_slot(struct slab_metadata *metadata, size_t index) {
|
||||||
check_index(index);
|
|
||||||
return (metadata->bitmap >> index) & 1UL;
|
return (metadata->bitmap >> index) & 1UL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue