summaryrefslogtreecommitdiff
path: root/src/kernel/mem
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/mem')
-rw-r--r--src/kernel/mem/alloc.c4
-rw-r--r--src/kernel/mem/alloc.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/kernel/mem/alloc.c b/src/kernel/mem/alloc.c
index 3925689..797b018 100644
--- a/src/kernel/mem/alloc.c
+++ b/src/kernel/mem/alloc.c
@@ -102,9 +102,9 @@ void page_free(void *first_addr, size_t pages) {
}
}
-void kmalloc_sanity(void *addr) {
+void kmalloc_sanity(const void *addr) {
assert(addr);
- struct malloc_hdr *hdr = addr - sizeof(struct malloc_hdr);
+ const struct malloc_hdr *hdr = addr - sizeof(struct malloc_hdr);
assert(hdr->magic == MALLOC_MAGIC);
if (hdr->next) assert(hdr->next->prev == hdr);
if (hdr->prev) assert(hdr->prev->next == hdr);
diff --git a/src/kernel/mem/alloc.h b/src/kernel/mem/alloc.h
index 0760d67..99fd931 100644
--- a/src/kernel/mem/alloc.h
+++ b/src/kernel/mem/alloc.h
@@ -12,6 +12,6 @@ void *page_alloc(size_t pages);
// frees `pages` consecutive pages starting from *first
void page_free(void *first, size_t pages);
-void kmalloc_sanity(void *addr);
+void kmalloc_sanity(const void *addr);
void *kmalloc(size_t len);
void kfree(void *ptr);