mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:27:35 +00:00
Kernel: Declare operator new/delete noexcept for MAKE_SLAB_ALLOCATED
This commit is contained in:
parent
788075c58b
commit
6d39b792f0
1 changed files with 5 additions and 5 deletions
|
@ -19,11 +19,11 @@ void slab_dealloc(void*, size_t slab_size);
|
|||
void slab_alloc_init();
|
||||
void slab_alloc_stats(Function<void(size_t slab_size, size_t allocated, size_t free)>);
|
||||
|
||||
#define MAKE_SLAB_ALLOCATED(type) \
|
||||
public: \
|
||||
void* operator new(size_t) { return slab_alloc(sizeof(type)); } \
|
||||
void operator delete(void* ptr) { slab_dealloc(ptr, sizeof(type)); } \
|
||||
\
|
||||
#define MAKE_SLAB_ALLOCATED(type) \
|
||||
public: \
|
||||
[[nodiscard]] void* operator new(size_t) noexcept { return slab_alloc(sizeof(type)); } \
|
||||
void operator delete(void* ptr) noexcept { slab_dealloc(ptr, sizeof(type)); } \
|
||||
\
|
||||
private:
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue