From 1163e0a030be34188e93a72aa6f110f7963e4877 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 25 Apr 2019 23:18:11 +0200 Subject: [PATCH] Kernel: Don't count kfree(nullptr) as a call to kfree(). This was causing the kmalloc/kfree call delta to accumulate errors. --- Kernel/kmalloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/kmalloc.cpp b/Kernel/kmalloc.cpp index 0312fa7db9..af65f5f341 100644 --- a/Kernel/kmalloc.cpp +++ b/Kernel/kmalloc.cpp @@ -166,11 +166,11 @@ void* kmalloc_impl(size_t size) void kfree(void *ptr) { - ++g_kfree_call_count; if (!ptr) return; InterruptDisabler disabler; + ++g_kfree_call_count; auto* a = (allocation_t*)((((byte*)ptr) - sizeof(allocation_t)));