Re: g_try_new and g_try_new0 + error reporting for g_object_set



Hi Stefan,

On Wed, 09 Mar 2005 02:21:16 +0900, Stefan Kost wrote:
> Matthias Clasen wrote:
...
> > g_new and g_new0
...
> I am aware that I can write my own. But if many people do that it might make
> sense to have them in the lib.
> 
> What do other do in this case?

Nothing as general UNIX libraries applications incl. the Gnome ones do not
handle the OOM case at all and they are expected to crash on swap exhaustion.
At least Linux kernel will start killing the processes itself anyway.

And it does not make sense to precisely handle each OOM case properly in your
code as any other library you call and even any other process on the system
will crash or gets killed in such OOM case anyway.

You need to secure your UNIX system against OOM on per-fork/exec case (with
same recoveries/restarts), not per-alloc case.


Regards,
Lace



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