From 96b32f5a939237db167c6f2138fc819c15b8ff7c Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 4 Dec 2022 12:55:32 +0100 Subject: [PATCH] Please use make and destroy instead of new and delete Those are there only for common stuff (in the Luna library) that needs an environment-agnostic way of allocating memory. new and delete are standard, thus we should use those. --- kernel/src/memory/Heap.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/src/memory/Heap.cpp b/kernel/src/memory/Heap.cpp index 1189b8dc..ceb96406 100644 --- a/kernel/src/memory/Heap.cpp +++ b/kernel/src/memory/Heap.cpp @@ -368,12 +368,14 @@ void dump_heap_usage() void* operator new(usize size) { - return kmalloc(size).expect_release_value("FIXME: Kernel new panics on OOM, since there are no exceptions"); + return kmalloc(size).expect_release_value("FIXME: Kernel new panics on OOM, since there are no exceptions. If " + "possible, use make for error propagation."); } void* operator new[](usize size) { - return kmalloc(size).expect_release_value("FIXME: Kernel new[] panics on OOM, since there are no exceptions"); + return kmalloc(size).expect_release_value("FIXME: Kernel new[] panics on OOM, since there are no exceptions. If " + "possible, use make for error propagation."); } void operator delete(void* p)