mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 22:48:01 +00:00
improved runtime error handling
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user