Re: glib outstanding stuff

Hi  Havoc,

> > Any reason, you're not using GString as the return value?
> >
> GString may force an extra copy, if we use try_malloc(). 

Constructing a GString from a mem area doesn't seem like a big problem and not
very dangerous. This should actually be an exported function, because if
somebody is using GStrings as function arguments, it should be possible to
construct it from a GLib-allocated mem-region + length without copy. On the
other hand of course GString is not all that usefull in it's current state,
apart from g_string_sprintf.

> Also, it
> seems a bit nicer to me this way, because you can just get a plain
> string if you want by passing NULL for the length location.

But as long as possible I think, returned values should be just that:

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]