Re: g_string_free



Hi Raja,

On 28 Jul 2000, Raja R Harinath wrote:
> > Then I can remove lines and tedium from my code having:
> > 
> > 	GString *str = g_string_new ("foo");
> > 	g_string_append (str, "baa");
> > 	return g_string_free (str, FALSE);
> 
> That functionality seems to be too much of an exception from normal
> _free semantics, and on the first glance, the usage appears to be an
> error.  Maybe it should be a new function

	Hmm; but we already have this boolean to g_string_free and everyo
ne understands its use;  I am merely asking for a small feature, that of
returning the ->str element from the free; most people will never notice
the change, there will be no code changes required to accomodate it, and I
think it will considerably shorten and simplify several code paths I have
as well as ( perhaps ) saving registers on register poor architectures. It
will also help stop people doing:

	g_string_free (str, FALSE);
	return str->str;

	Which I'm willing to bet people do around the place.

	Regards,

		Michael.

-- 
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot





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