# HG changeset patch # User jwe # Date 777664640 0 # Node ID 5338832d2cf6d2ff64b2b007e3e84dfa9f43773e # Parent e045273669176097f6be6d3648b5d09d6a4a449d [project @ 1994-08-23 17:57:20 by jwe] diff -r e04527366917 -r 5338832d2cf6 src/sighandlers.cc --- a/src/sighandlers.cc Mon Aug 22 23:44:52 1994 +0000 +++ b/src/sighandlers.cc Tue Aug 23 17:57:20 1994 +0000 @@ -25,6 +25,7 @@ #include "config.h" #endif +#include #include #include "sighandlers.h" @@ -46,9 +47,16 @@ clean_up_and_exit (sig_number); } -/* - * Some of these may eventually perform different actions... - */ +// I know, not really a signal handler. + +static void +octave_new_handler (void) +{ + error ("new: virtual memory exhausted -- stopping myself"); + clean_up_and_exit (1); +} + +// Some of these may eventually perform different actions... static RETSIGTYPE sigabrt_handler (int i) @@ -92,9 +100,8 @@ my_friendly_exit ("SIGILL", i); } -/* - * Handle SIGINT by restarting the parser (see octave.cc). - */ +// Handle SIGINT by restarting the parser (see octave.cc). + static RETSIGTYPE sigint_handler (int i) { @@ -212,12 +219,13 @@ my_friendly_exit ("SIGXFSZ", i); } -/* - * Install all the handlers for the signals we might care about. - */ +// Install all the handlers for the signals we might care about. + void install_signal_handlers (void) { + set_new_handler (octave_new_handler); + #ifdef SIGABRT signal (SIGABRT, sigabrt_handler); #endif