Print the error instead

This commit is contained in:
apio 2022-12-04 12:57:43 +01:00
parent 96b32f5a93
commit 22019ac6b2
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -368,14 +368,16 @@ 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. If "
"possible, use make<T> for error propagation.");
auto rc = kmalloc(size);
if (rc.has_error()) { expect(false, rc.error_string()); }
return rc.release_value();
}
void* operator new[](usize size)
{
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.");
auto rc = kmalloc(size);
if (rc.has_error()) { expect(false, rc.error_string()); }
return rc.release_value();
}
void operator delete(void* p)