Mail Archives: djgpp/1996/05/25/01:10:17
malcolm AT manawatu DOT gen DOT nz (Malcolm Taylor) wrote:
>I would like to be able to trap a failed call to malloc (or new) and
>exit gracefully with a message about running out of memory.
I seem to have been a little imprecise here. I know that you can check
for NULL return from malloc, and I know about the new handler. I was
wondering about more non-standard methods (or standard practices) to
get the above result. Basicly I coded assuming I had enough memory,
this is almost always true in dos (unless I have a memory leak), but
under Windows and OS/2 the amount of memory given to the program is
often too small, in these cases I would like my already written code
to be able to exit a little more gracefully.
Thanks,
Malcolm
- Raw text -