diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-25 23:18:11 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-25 23:18:11 +0200 |
commit | 1163e0a030be34188e93a72aa6f110f7963e4877 (patch) | |
tree | f733ce91a43c93299de2b2af8b9c7641ec7e8b53 | |
parent | 96d4b701e626c735cea447b5b0664d1b420a00fb (diff) | |
download | serenity-1163e0a030be34188e93a72aa6f110f7963e4877.zip |
Kernel: Don't count kfree(nullptr) as a call to kfree().
This was causing the kmalloc/kfree call delta to accumulate errors.
-rw-r--r-- | Kernel/kmalloc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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))); |