Intern type names before registering the type to avoid unnecessary copies.
authorMatthias Clasen <mclasen@redhat.com>
Wed, 31 Aug 2005 14:38:18 +0000 (14:38 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 31 Aug 2005 14:38:18 +0000 (14:38 +0000)
2005-08-31  Matthias Clasen  <mclasen@redhat.com>

* gvaluetypes.c (g_value_types_init):
* gtypeplugin.c (g_type_plugin_get_type):
* gtypemodule.c (g_type_module_get_type):
* gparam.c (g_param_type_init):
* gobject.c (g_object_type_init):
* genums.c (g_enum_types_init):
* gboxed.c (g_boxed_type_init): Intern type names
before registering the type to avoid unnecessary
copies.

gobject/ChangeLog
gobject/gboxed.c
gobject/genums.c
gobject/gobject.c
gobject/gparam.c
gobject/gtypemodule.c
gobject/gtypeplugin.c
gobject/gvaluetypes.c

index b495083..bbad946 100644 (file)
@@ -1,3 +1,15 @@
+2005-08-31  Matthias Clasen  <mclasen@redhat.com>
+
+       * gvaluetypes.c (g_value_types_init): 
+       * gtypeplugin.c (g_type_plugin_get_type): 
+       * gtypemodule.c (g_type_module_get_type): 
+       * gparam.c (g_param_type_init): 
+       * gobject.c (g_object_type_init): 
+       * genums.c (g_enum_types_init): 
+       * gboxed.c (g_boxed_type_init): Intern type names
+       before registering the type to avoid unnecessary
+       copies.
+
 2005-08-23  Matthias Clasen  <mclasen@redhat.com>
 
        * === Released 2.8.1 ===
index 43256ee..1ef11b5 100644 (file)
@@ -139,7 +139,7 @@ g_boxed_type_init (void)
 
   /* G_TYPE_BOXED
    */
-  type = g_type_register_fundamental (G_TYPE_BOXED, "GBoxed", &info, &finfo,
+  type = g_type_register_fundamental (G_TYPE_BOXED, g_intern_static_string ("GBoxed"), &info, &finfo,
                                      G_TYPE_FLAG_ABSTRACT | G_TYPE_FLAG_VALUE_ABSTRACT);
   g_assert (type == G_TYPE_BOXED);
 }
index 2ce3dc3..f5d2115 100644 (file)
@@ -86,14 +86,14 @@ g_enum_types_init (void)
   /* G_TYPE_ENUM
    */
   info.class_size = sizeof (GEnumClass);
-  type = g_type_register_fundamental (G_TYPE_ENUM, "GEnum", &info, &finfo,
+  type = g_type_register_fundamental (G_TYPE_ENUM, g_intern_static_string ("GEnum"), &info, &finfo,
                                      G_TYPE_FLAG_ABSTRACT | G_TYPE_FLAG_VALUE_ABSTRACT);
   g_assert (type == G_TYPE_ENUM);
   
   /* G_TYPE_FLAGS
    */
   info.class_size = sizeof (GFlagsClass);
-  type = g_type_register_fundamental (G_TYPE_FLAGS, "GFlags", &info, &finfo,
+  type = g_type_register_fundamental (G_TYPE_FLAGS, g_intern_static_string ("GFlags"), &info, &finfo,
                                      G_TYPE_FLAG_ABSTRACT | G_TYPE_FLAG_VALUE_ABSTRACT);
   g_assert (type == G_TYPE_FLAGS);
 }
index 6628ba7..0e3f2cd 100644 (file)
@@ -185,7 +185,7 @@ g_object_type_init (void)
   /* G_TYPE_OBJECT
    */
   info.value_table = &value_table;
-  type = g_type_register_fundamental (G_TYPE_OBJECT, "GObject", &info, &finfo, 0);
+  type = g_type_register_fundamental (G_TYPE_OBJECT, g_intern_static_string ("GObject"), &info, &finfo, 0);
   g_assert (type == G_TYPE_OBJECT);
   g_value_register_transform_func (G_TYPE_OBJECT, G_TYPE_OBJECT, g_value_object_transform_value);
   
index 0d97e37..3174715 100644 (file)
@@ -103,7 +103,7 @@ g_param_type_init (void)
   };
   GType type;
 
-  type = g_type_register_fundamental (G_TYPE_PARAM, "GParam", &param_spec_info, &finfo, G_TYPE_FLAG_ABSTRACT);
+  type = g_type_register_fundamental (G_TYPE_PARAM, g_intern_static_string ("GParam"), &param_spec_info, &finfo, G_TYPE_FLAG_ABSTRACT);
   g_assert (type == G_TYPE_PARAM);
   g_value_register_transform_func (G_TYPE_PARAM, G_TYPE_PARAM, value_param_transform_value);
 }
index 22e86f3..7a4ef21 100644 (file)
@@ -123,7 +123,7 @@ g_type_module_get_type (void)
         NULL,               /* interface_data */
       };
 
-      type_module_type = g_type_register_static (G_TYPE_OBJECT, "GTypeModule", &type_module_info, G_TYPE_FLAG_ABSTRACT);
+      type_module_type = g_type_register_static (G_TYPE_OBJECT, g_intern_static_string ("GTypeModule"), &type_module_info, G_TYPE_FLAG_ABSTRACT);
 
       g_type_add_interface_static (type_module_type, G_TYPE_TYPE_PLUGIN, &iface_info);
     }
index bc1e7c0..2d681bd 100644 (file)
@@ -35,7 +35,7 @@ g_type_plugin_get_type (void)
        NULL,           /* base_finalize */
       };
       
-      type_plugin_type = g_type_register_static (G_TYPE_INTERFACE, "GTypePlugin", &type_plugin_info, 0);
+      type_plugin_type = g_type_register_static (G_TYPE_INTERFACE, g_intern_static_string ("GTypePlugin"), &type_plugin_info, 0);
     }
   
   return type_plugin_type;
index b5380ee..cb3de7e 100644 (file)
@@ -389,9 +389,9 @@ g_value_types_init (void)
       value_lcopy_char,                /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_CHAR, "gchar", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_CHAR, g_intern_static_string ("gchar"), &info, &finfo, 0);
     g_assert (type == G_TYPE_CHAR);
-    type = g_type_register_fundamental (G_TYPE_UCHAR, "guchar", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_UCHAR, g_intern_static_string ("guchar"), &info, &finfo, 0);
     g_assert (type == G_TYPE_UCHAR);
   }
 
@@ -409,7 +409,7 @@ g_value_types_init (void)
       value_lcopy_boolean,      /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_BOOLEAN, "gboolean", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_BOOLEAN, g_intern_static_string ("gboolean"), &info, &finfo, 0);
     g_assert (type == G_TYPE_BOOLEAN);
   }
   
@@ -427,9 +427,9 @@ g_value_types_init (void)
       value_lcopy_int,         /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_INT, "gint", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_INT, g_intern_static_string ("gint"), &info, &finfo, 0);
     g_assert (type == G_TYPE_INT);
-    type = g_type_register_fundamental (G_TYPE_UINT, "guint", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_UINT, g_intern_static_string ("guint"), &info, &finfo, 0);
     g_assert (type == G_TYPE_UINT);
   }
 
@@ -447,9 +447,9 @@ g_value_types_init (void)
       value_lcopy_long,                /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_LONG, "glong", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_LONG, g_intern_static_string ("glong"), &info, &finfo, 0);
     g_assert (type == G_TYPE_LONG);
-    type = g_type_register_fundamental (G_TYPE_ULONG, "gulong", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_ULONG, g_intern_static_string ("gulong"), &info, &finfo, 0);
     g_assert (type == G_TYPE_ULONG);
   }
   
@@ -467,9 +467,9 @@ g_value_types_init (void)
       value_lcopy_int64,       /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_INT64, "gint64", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_INT64, g_intern_static_string ("gint64"), &info, &finfo, 0);
     g_assert (type == G_TYPE_INT64);
-    type = g_type_register_fundamental (G_TYPE_UINT64, "guint64", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_UINT64, g_intern_static_string ("guint64"), &info, &finfo, 0);
     g_assert (type == G_TYPE_UINT64);
   }
   
@@ -487,7 +487,7 @@ g_value_types_init (void)
       value_lcopy_float,        /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_FLOAT, "gfloat", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_FLOAT, g_intern_static_string ("gfloat"), &info, &finfo, 0);
     g_assert (type == G_TYPE_FLOAT);
   }
   
@@ -505,7 +505,7 @@ g_value_types_init (void)
       value_lcopy_double,      /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_DOUBLE, "gdouble", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_DOUBLE, g_intern_static_string ("gdouble"), &info, &finfo, 0);
     g_assert (type == G_TYPE_DOUBLE);
   }
 
@@ -523,7 +523,7 @@ g_value_types_init (void)
       value_lcopy_string,      /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_STRING, "gchararray", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_STRING, g_intern_static_string ("gchararray"), &info, &finfo, 0);
     g_assert (type == G_TYPE_STRING);
   }
 
@@ -541,7 +541,7 @@ g_value_types_init (void)
       value_lcopy_pointer,     /* lcopy_value */
     };
     info.value_table = &value_table;
-    type = g_type_register_fundamental (G_TYPE_POINTER, "gpointer", &info, &finfo, 0);
+    type = g_type_register_fundamental (G_TYPE_POINTER, g_intern_static_string ("gpointer"), &info, &finfo, 0);
     g_assert (type == G_TYPE_POINTER);
   }
 }