diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-05-11 03:51:31 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-13 08:29:01 +0200 |
commit | 6d39b792f0e890fc57a754664735a7bcdfa265e3 (patch) | |
tree | 522106e9542ac14acad9168211e3ec726888b3ee /Kernel/Heap | |
parent | 788075c58b7bb6cead67c8f35b61dde3f7045c0a (diff) | |
download | serenity-6d39b792f0e890fc57a754664735a7bcdfa265e3.zip |
Kernel: Declare operator new/delete noexcept for MAKE_SLAB_ALLOCATED
Diffstat (limited to 'Kernel/Heap')
-rw-r--r-- | Kernel/Heap/SlabAllocator.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/Heap/SlabAllocator.h b/Kernel/Heap/SlabAllocator.h index f6c67bfea8..de826d38e7 100644 --- a/Kernel/Heap/SlabAllocator.h +++ b/Kernel/Heap/SlabAllocator.h @@ -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: } |