mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-01 19:16:29 -04:00
improved runtime error handling
This commit is contained in:
parent
ed1c2e1c03
commit
b83f43793c
6 changed files with 75 additions and 28 deletions
|
@ -26,11 +26,17 @@
|
|||
#include <ch.h>
|
||||
|
||||
void* operator new(size_t size) {
|
||||
return chHeapAlloc(0x0, size);
|
||||
void *p = chHeapAlloc(0x0, size);
|
||||
if (p == nullptr)
|
||||
chDbgPanic("Out of Memory");
|
||||
return p;
|
||||
}
|
||||
|
||||
void* operator new[](size_t size) {
|
||||
return chHeapAlloc(0x0, size);
|
||||
void *p = chHeapAlloc(0x0, size);
|
||||
if (p == nullptr)
|
||||
chDbgPanic("Out of Memory");
|
||||
return p;
|
||||
}
|
||||
|
||||
void operator delete(void* p) noexcept {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue