Re: [patch] calling g_malloc & co via a vtable

Hej Alexander,

> > But there are no callbacks. So if you want callbacks, you have to program
> > them yourself and then you are free to add a try_malloc function to aid
> > that callback. But I think, _GLib_ doesn't need both functions (What I
> > mean is: GLib needs to have g_try_alloc, but not try_malloc in
> > GMemFunctions)
> Lets say there is only malloc in GMemFunctions and I implement a custom
> malloc that calls a callback on failure. If I then call g_try_malloc() and
> if fails it will be the custom handler that fails, and it will call the
> callback.

But if you are using the callback, then you know the concrete GMemFunctions
implementation (otherwise there is no callback) and this implementation then
has to provide that facility for you. What does glib have to do with that?

Hej då,
Sebastian Wilhelmi                   |            här ovanför alla molnen
mailto:wilhelmi ira uka de           |     är himmlen så förunderligt blå   |

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