Re: [gtk-list] Re: g_malloc() aborts when enough memory is notfound?
- From: Paul Barton-Davis <pbd op net>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: g_malloc() aborts when enough memory is notfound?
- Date: Wed, 03 Nov 1999 13:53:57 -0500
>This is why I don't think trying to be well behaved on
>out-of-memory is all that useful. Of course, if it helps
>the user to recover even 10% of the time, it may be worth
>supporting....
given that i broadly agree with the argument in Owen's message, I
would point out that you *can* catch SIGABRT yourself. Yes, its true
that you can't know for sure that you were sent it because of an out
of memory problem, but perhaps glib could just help with that:
void
abort_handler (int sig)
{
if (glib_out_of_memory()) {
do_something_that_does_not_call_malloc_well_probably_anyway();
_exit (1);
} else {
... hmmm, why are we here ? ...
}
}
that is, glib should make it possible to determine that its last call
to malloc failed.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]