Re: out-of-mem handler
- From: Havoc Pennington <hp redhat com>
- To: gtk-devel-list redhat com
- Subject: Re: out-of-mem handler
- Date: 14 Feb 2000 11:53:42 -0500
Sebastian Wilhelmi <email@example.com> writes:
> Do not add a callback for out of memory. You wouldn't be allowed to call any
> glib-function (let alone GTK) inside this handler, as that might screw up the
> internal state, depending on where the g_malloc call came from, also Xlib
> doesn't allow overloading the Xmalloc. Thus the callback wouldn't be called,
> when out of mem in X.
The only reason I want a callback is to do this:
p = g_malloc_try();
(perhaps with a max number of tries for safety)
I want this specifically for gnome-session. If other apps do this it's
obviously very bad, but gnome-session should not be the app to fall
over if memory runs out.
> Add a g_malloc_try (we already talked about it then). This is a really
> necessary function, but a handler will yield exactly nothing.
Right, I remember we wanted the _try() functions.
] [Thread Prev