A emulator uses lots of system memory for everything. Sometimes, the system might be overloaded, and we get a memory error when trying to allocate memory for the emu. Take a look at this code:
long *myArr;
..... inside some function ......
myArr = new long[64*1024*1024]; //allocate 64MB of RAM memory
in most of the cases, this code will work, but, sometimes, we'll get an error from windows (when physical ram memory is too low, windows denies memory requests from other applications until some part of the physical memory is free, even if virtual memory is not that full). How can I detect this windows deny in order to prevent my application from shutting down?
long *myArr;
..... inside some function ......
myArr = new long[64*1024*1024]; //allocate 64MB of RAM memory
in most of the cases, this code will work, but, sometimes, we'll get an error from windows (when physical ram memory is too low, windows denies memory requests from other applications until some part of the physical memory is free, even if virtual memory is not that full). How can I detect this windows deny in order to prevent my application from shutting down?