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:
parent
96d4b701e6
commit
1163e0a030
Notes:
sideshowbarker
2024-07-19 14:35:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1163e0a030b
1 changed files with 1 additions and 1 deletions
|
@ -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)));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue