Print the error instead
This commit is contained in:
parent
96b32f5a93
commit
22019ac6b2
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user