Re: g_*printf() (Was: gtk+-1.1.6 report)



Hi, Aaron

> > I would like to suggest
> >
> >    gchar *g_printf_new(gchar const *fmt, ...)
> >
> > which returns a pointer to a string with apropriate length.
> > In my humble opinion this is a very often needed thing.
> 
> Along these lines, I'd suggest a "out-of-memory" hook. The standard hook
> should abort the program. The reason behind this is that the program
> should print a meaningful error when it runs out of memory but most people
> don't want to add a check after every invokation of g_printf_new().
> (and that should be g_sprintf_new() :-)

As mentioned earlier, g_strdup_printf does, what is wanted, as for the
hook, glib never returns on memory errors, but simply aborts. As I tried
to explain earlier, this is a good thing (i.e. to simply abort and not
provide a callback in case of memory shortage; see thread "[gtk-list]
1.1.5 g_timer_new bug!")

Bye,
Sebastian
-- 
+--------------============####################============--------------+
| Sebastian Wilhelmi, Institute for Computer Design and Fault Tolerance, |
| University of Karlsruhe;  Building 20.20, Room 263,  D-76128 Karlsruhe |
| mail: wilhelmi@ira.uka.de;  fax: +49 721 370455;  fon: +49 721 6084353 |
+-----------------> http://goethe.ira.uka.de/~wilhelmi <-----------------+



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