Re: out of memory handler



On Tue, 28 Dec 2004 18:27:45 +0200, Baurjan Ismagulov
<ibr ata cs hun edu tr> wrote:
> Hello,
> 
> I'm using The GList API of glib 2.6.0 and wish to redefine the out of
> memory handler. What is the best way to do that? If I have to modify
> glib itself, is it enough to replace g_error?

    If GTK+ encounters an oom condition, your program will abort(), the sky
is ocasionally blue and pigs unfortunatly, do not fly :(

but seriously, I think it would be a noble cause to make `abort()' on oom
optional but it would require alot of work. The entire GTK+ codebase would
have to be refactored. To start with: class / instance initialization
functions in
GObject would have to support oom conditions and return FALSE if they werent 
capable to allocate enough resources (right now they return `void').

many many lines of code... But IMO, definitly a noble cause :)

Cheers,
                                              -Tristan



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