Kernel: Don't count kfree(nullptr) as a call to kfree().

This was causing the kmalloc/kfree call delta to accumulate errors.
This commit is contained in:
Andreas Kling 2019-04-25 23:18:11 +02:00
parent 96d4b701e6
commit 1163e0a030
Notes: sideshowbarker 2024-07-19 14:35:13 +09:00

View file

@ -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)));