mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
abort when malloc fails
This commit is contained in:
parent
8a86a45e19
commit
bfb9453f37
@ -22,7 +22,12 @@
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
||||||
void *default_operator_new(size_t size) {
|
void *default_operator_new(size_t size) {
|
||||||
return malloc(size);
|
void *ptr = malloc(size);
|
||||||
|
if (ptr == (void *)NULL) {
|
||||||
|
cerr << "Out of memory!\n";
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void default_operator_delete(void *ptr) {
|
void default_operator_delete(void *ptr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user