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)
|
void* operator new(usize size)
|
||||||
{
|
{
|
||||||
return kmalloc(size).expect_release_value("FIXME: Kernel new panics on OOM, since there are no exceptions. If "
|
auto rc = kmalloc(size);
|
||||||
"possible, use make<T> for error propagation.");
|
if (rc.has_error()) { expect(false, rc.error_string()); }
|
||||||
|
return rc.release_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
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. If "
|
auto rc = kmalloc(size);
|
||||||
"possible, use make<T> for error propagation.");
|
if (rc.has_error()) { expect(false, rc.error_string()); }
|
||||||
|
return rc.release_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void* p)
|
void operator delete(void* p)
|
||||||
|
Loading…
Reference in New Issue
Block a user