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:
parent
adb2c2ab41
commit
96b32f5a93
@ -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<T> 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<T> for error propagation.");
|
||||
}
|
||||
|
||||
void operator delete(void* p)
|
||||
|
Loading…
Reference in New Issue
Block a user