Mail Archives: djgpp/1998/05/13/17:13:46
"Paul Derbyshire" <pderbysh AT usa DOT net> wrote:
>In GCC 2.8.1, for some unfathomable reason, it prints "Virtual memory exhausted
>in new" and dies.
>This can be fixed:
>
>void my_new_handler (void) { throw bad_alloc(); }
>
>int main (void) {
> set_new_handler (my_new_handler); // See relevant C++ docs, e.g. Stroustrup.
> /* ... */
> try {
> int *foo=new int[len];
> } catch (bad_alloc) {
> /* ... */
> }
> /* ... */
>}
Is it possible to set this up to be the default behavior my modifying
some startup file or other? So you don't have to keep doing it in
every program?
David.
David Vrabel d DOT vrabel AT n-shropshire DOT ac DOT uk
A poor student (aren't they all) at:
North Shropshire College
Oswestry, Shropshire, UK
- Raw text -