Please use make<T> and destroy<T> 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.
This commit is contained in:
apio 2022-12-04 12:55:32 +01:00
parent adb2c2ab41
commit 96b32f5a93
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -368,12 +368,14 @@ void dump_heap_usage()
void* operator new(usize size) 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<T> for error propagation.");
} }
void* operator new[](usize size) 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<T> for error propagation.");
} }
void operator delete(void* p) void operator delete(void* p)