mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
Add a kmalloc_eternal() for things that will never be destroyed.
This commit is contained in:
parent
d980ddc745
commit
9a086b2d35
Notes:
sideshowbarker
2024-07-19 18:35:26 +09:00
Author: https://github.com/awesomekling
Commit: 9a086b2d35
20 changed files with 85 additions and 20 deletions
11
AK/kmalloc.h
11
AK/kmalloc.h
|
@ -2,6 +2,15 @@
|
|||
|
||||
#include "Compiler.h"
|
||||
|
||||
#if defined(SERENITY) && defined(KERNEL)
|
||||
#define AK_MAKE_ETERNAL \
|
||||
public: \
|
||||
void* operator new(size_t size) { return kmalloc_eternal(size); } \
|
||||
private:
|
||||
#else
|
||||
#define AK_MAKE_ETERNAL
|
||||
#endif
|
||||
|
||||
#ifdef SERENITY
|
||||
#ifdef KERNEL
|
||||
#include <Kernel/kmalloc.h>
|
||||
|
@ -14,6 +23,7 @@ void* kcalloc(size_t nmemb, size_t size);
|
|||
void* kmalloc(size_t size) MALLOC_ATTR;
|
||||
void kfree(void* ptr);
|
||||
void* krealloc(void* ptr, size_t size);
|
||||
void* kmalloc_eternal(size_t) MALLOC_ATTR;
|
||||
|
||||
}
|
||||
|
||||
|
@ -61,6 +71,7 @@ void* kcalloc(size_t nmemb, size_t size);
|
|||
void* kmalloc(size_t size) MALLOC_ATTR;
|
||||
void kfree(void* ptr);
|
||||
void* krealloc(void* ptr, size_t size);
|
||||
void* kmalloc_eternal(size_t) MALLOC_ATTR;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue