Re: glib outstanding stuff
- From: Sebastian Wilhelmi <wilhelmi ira uka de>
- To: Havoc Pennington <hp redhat com>
- Cc: Gtk Development List <gtk-devel-list gnome org>
- Subject: Re: glib outstanding stuff
- Date: Mon, 09 Oct 2000 13:11:45 +0200
> > 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å
] [Thread Prev