diff --git a/kernel/src/memory/Heap.cpp b/kernel/src/memory/Heap.cpp index f8fd6210..4259e61b 100644 --- a/kernel/src/memory/Heap.cpp +++ b/kernel/src/memory/Heap.cpp @@ -382,20 +382,28 @@ void* operator new[](usize size) void operator delete(void* p) { - kfree(p); + auto rc = kfree(p); + if (rc.has_error()) { expect(false, rc.error_string()); } + return rc.release_value(); } void operator delete[](void* p) { - kfree(p); + auto rc = kfree(p); + if (rc.has_error()) { expect(false, rc.error_string()); } + return rc.release_value(); } void operator delete(void* p, usize) { - kfree(p); + auto rc = kfree(p); + if (rc.has_error()) { expect(false, rc.error_string()); } + return rc.release_value(); } void operator delete[](void* p, usize) { - kfree(p); + auto rc = kfree(p); + if (rc.has_error()) { expect(false, rc.error_string()); } + return rc.release_value(); } \ No newline at end of file