Re: g_intern_static_string() for type names as small optimization
- From: Behdad Esfahbod <behdad behdad org>
- To: Matthias Clasen <matthias clasen gmail com>
- Cc: gtk-devel-list gnome org, Ross Burton <ross burtonini com>
- Subject: Re: g_intern_static_string() for type names as small optimization
- Date: Wed, 16 Jan 2008 13:41:48 -0500
On Wed, 2008-01-16 at 12:43 -0500, Matthias Clasen wrote:
>
> The thing is that GObject interns the type name anyway. But, as you
> say,
> it cannot assume that the string is static and thus calls
> g_intern_string(),
> causing it to be copied. By interning it using
> g_intern_static_string() beforehand,
> we guarantee that the string is already interned at the time that
> gobject calls
> g_intern_string, and thus won't be copied.
One would think that the "_static" in g_type_register_static() means
that it doesn't copy its arguments, but apparently this static is
different...
--
behdad
http://behdad.org/
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]