Kernel: Remove kfree(), leaving only kfree_sized() :^)

There are no more users of the C-style kfree() API in the kernel,
so let's get rid of it and enjoy the new world where we always know
how much memory we are freeing. :^)
This commit is contained in:
Andreas Kling 2021-12-26 18:10:35 +01:00
parent 6eb48f7df6
commit c6c786c992
Notes: sideshowbarker 2024-07-17 22:10:06 +09:00
2 changed files with 2 additions and 7 deletions

View file

@ -273,16 +273,12 @@ void* kmalloc(size_t size)
}
void kfree_sized(void* ptr, size_t size)
{
(void)size;
return kfree(ptr);
}
void kfree(void* ptr)
{
if (!ptr)
return;
VERIFY(size > 0);
kmalloc_verify_nospinlock_held();
SpinlockLocker lock(s_lock);
++g_kfree_call_count;

View file

@ -41,7 +41,6 @@ enum class align_val_t : size_t {};
void kmalloc_init();
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] void* kmalloc_eternal(size_t);
void kfree(void*);
void kfree_sized(void*, size_t);
struct kmalloc_stats {