Re: *_type_register_static() and g_intern_static_string()



On 4/27/07, Damon Chaplin <damon karuna eclipse co uk> wrote:

Why do the *_type_register_static() functions use
g_intern_static_string() for the type name?

Should apps be using g_intern_static_string() as well? If so, the docs
should mention it.

It is just a small optimization. Apps are free to use it, but it is not
the end of the world if they don't.

There is some inconsistency as well. Some calls don't seem to use it:
"GtkPaperSize" "GtkTextIter" "GtkRecentInfo" "GtkIconSource"
"GtkWidget" "GtkIconViewAccessible" "GtkIconViewAccessibleFactory"
"GtkAssistantAccessible" "GtkAssistantAccessibleFactory"

I'll fix that.



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