mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
Add a kmalloc_eternal() for things that will never be destroyed.
This commit is contained in:
parent
d980ddc745
commit
9a086b2d35
20 changed files with 85 additions and 20 deletions
|
@ -39,6 +39,11 @@ void* krealloc(void* ptr, size_t size)
|
|||
return realloc(ptr, size);
|
||||
}
|
||||
|
||||
void* kmalloc_eternal(size_t size)
|
||||
{
|
||||
return kmalloc(size);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -59,6 +64,13 @@ void* kmalloc(size_t size)
|
|||
return SimpleMalloc::allocate(size);
|
||||
}
|
||||
|
||||
void* kmalloc_eternal(size_t size)
|
||||
{
|
||||
if (!size)
|
||||
return nullptr;
|
||||
return SimpleMalloc::allocate(size);
|
||||
}
|
||||
|
||||
void kfree(void* ptr)
|
||||
{
|
||||
if (!ptr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue