glib dependency for the X Server
John Hughes
john at Calva.COM
Mon Apr 3 05:53:10 PDT 2006
Ikke wrote:
>>Just started working on a minor patch for this. Although I doubt it'll
>>be accepted... Who knows ;-)
>>
>>
>
>Attached (sorry for the lag, food etc :-))
>
>Not extensively tested, blablabla. Should I get this into gnome
>bugzilla?
>
>
>+ /* Keep standard behaviour */
>+ if (G_LIKELY(g_malloc_failure_handler == NULL))
>+ {
> g_error ("%s: failed to allocate %lu bytes", G_STRLOC, n_bytes);
>+ }
>+ else
>+ {
>+ g_warning("%s: failed to allocate %lu bytes", G_STRLOC, n_bytes);
>+ g_malloc_failure_handler (n_bytes);
>+ }
> }
>
>
>
Not very interesting:
1. You give no way of avoiding the warning
2. You give no way of allocating the memory from somewhere else (e.g.
emergency pool, wait & retry...)
Why not just:
...
+ if (g_malloc_failure_handler)
+ return g_malloc_failure_handler (n_bytes);
g_error ("%s: failed to allocate %lu bytes", G_STRLOC, n_bytes);
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20060403/063f070a/attachment.html>
More information about the xorg
mailing list