mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 12:56:23 +03:00
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:
parent
6eb48f7df6
commit
c6c786c992
Notes:
sideshowbarker
2024-07-17 22:10:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c6c786c992d
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user