Re: Proposal: g_set_out_of_mem_handler



On Tue, 16 Nov 1999, Havoc Pennington wrote:

> Date: Tue, 16 Nov 1999 10:14:00 -0500 (EST)
> From: Havoc Pennington <hp@redhat.com>
> Reply-To: gtk-devel-list@redhat.com
> To: gtk-devel-list@redhat.com
> Subject: Re: Proposal: g_set_out_of_mem_handler
> Resent-Date: 16 Nov 1999 15:16:48 -0000
> Resent-From: gtk-devel-list@redhat.com
> Resent-cc: recipient list not shown: ;
> 
> 
> Hi,
> 
> I agree that we should go for the out of mem handler because:
> 
>  - it will use only a few bytes; one global function pointer, one 
>    function to set that pointer, one default handler that calls abort()
>  - it will make lots of people feel better, and who knows, may genuinely 
>    be useful in some cases

I think that this technique is pretty gross. Why not implement some kind of
exception handling instead? I've been working on a small exception handling
library which which is written in portable C and gives you things like: nested
try-catch regions which specify a list of what they catch; exceptions that have
code and group ID's so groups of exceptions can be caught as well as specific
exceptions; clean-up handlers for releasing resources during unwinding; passage
of arbitrary dynamic data from throw to catch site, etc.  With POSIX thread
support enabled, each thread has its own exception stack context, including its
own own allocator routines and unhandled exception catcher.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]