From 476e138db0be2a4dc527eeeaeecaf744043529e4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 31 Aug 2005 15:14:26 +0000 Subject: [PATCH] Intern type names before registering the type to avoid unnecessary copies. 2005-08-31 Matthias Clasen * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_get_type): * gdk/x11/gdkscreen-x11.c (_gdk_screen_x11_get_type): * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_impl_x11_get_type): * gdk/x11/gdkkeys-x11.c (gdk_keymap_x11_get_type): * gdk/x11/gdkinput.c (gdk_device_get_type): * gdk/x11/gdkimage-x11.c (gdk_image_get_type): * gdk/x11/gdkgc-x11.c (_gdk_gc_x11_get_type): * gdk/x11/gdkdrawable-x11.c (_gdk_drawable_impl_x11_get_type): * gdk/x11/gdkdnd-x11.c (gdk_drag_context_get_type): * gdk/x11/gdkdisplay-x11.c (_gdk_display_x11_get_type): * gdk/x11/gdkcolor-x11.c (gdk_colormap_get_type): * gdk/gdkwindow.c (gdk_window_object_get_type): * gdk/gdkscreen.c (gdk_screen_get_type): * gdk/gdkrectangle.c (gdk_rectangle_get_type): * gdk/gdkpixmap.c (gdk_pixmap_get_type): * gdk/gdkkeys.c (gdk_keymap_get_type): * gdk/gdkfont.c (gdk_font_get_type): * gdk/gdkevents.c (gdk_event_get_type): * gdk/gdkdraw.c (gdk_drawable_get_type): * gdk/gdkdisplaymanager.c (gdk_display_manager_get_type): * gdk/gdkdisplay.c (gdk_display_get_type): * gdk/gdkcursor.c (gdk_cursor_get_type): * gdk/gdkcolor.c (gdk_color_get_type): Intern type names before registering the type to avoid unnecessary copies. --- ChangeLog | 29 +++++++++++++++++++++++++++++ ChangeLog.pre-2-10 | 29 +++++++++++++++++++++++++++++ gdk/gdkcolor.c | 2 +- gdk/gdkcursor.c | 2 +- gdk/gdkdisplay.c | 2 +- gdk/gdkdisplaymanager.c | 2 +- gdk/gdkdraw.c | 2 +- gdk/gdkevents.c | 2 +- gdk/gdkfont.c | 2 +- gdk/gdkkeys.c | 2 +- gdk/gdkpixmap.c | 2 +- gdk/gdkrectangle.c | 2 +- gdk/gdkscreen.c | 2 +- gdk/gdkwindow.c | 2 +- gdk/x11/gdkcolor-x11.c | 2 +- gdk/x11/gdkdisplay-x11.c | 2 +- gdk/x11/gdkdnd-x11.c | 2 +- gdk/x11/gdkdrawable-x11.c | 2 +- gdk/x11/gdkgc-x11.c | 2 +- gdk/x11/gdkimage-x11.c | 2 +- gdk/x11/gdkinput.c | 2 +- gdk/x11/gdkkeys-x11.c | 2 +- gdk/x11/gdkpixmap-x11.c | 2 +- gdk/x11/gdkscreen-x11.c | 2 +- gdk/x11/gdkvisual-x11.c | 2 +- gdk/x11/gdkwindow-x11.c | 2 +- 26 files changed, 82 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9840704066..fbf0b34182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2005-08-31 Matthias Clasen + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_get_type): + * gdk/x11/gdkscreen-x11.c (_gdk_screen_x11_get_type): + * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_impl_x11_get_type): + * gdk/x11/gdkkeys-x11.c (gdk_keymap_x11_get_type): + * gdk/x11/gdkinput.c (gdk_device_get_type): + * gdk/x11/gdkimage-x11.c (gdk_image_get_type): + * gdk/x11/gdkgc-x11.c (_gdk_gc_x11_get_type): + * gdk/x11/gdkdrawable-x11.c (_gdk_drawable_impl_x11_get_type): + * gdk/x11/gdkdnd-x11.c (gdk_drag_context_get_type): + * gdk/x11/gdkdisplay-x11.c (_gdk_display_x11_get_type): + * gdk/x11/gdkcolor-x11.c (gdk_colormap_get_type): + * gdk/gdkwindow.c (gdk_window_object_get_type): + * gdk/gdkscreen.c (gdk_screen_get_type): + * gdk/gdkrectangle.c (gdk_rectangle_get_type): + * gdk/gdkpixmap.c (gdk_pixmap_get_type): + * gdk/gdkkeys.c (gdk_keymap_get_type): + * gdk/gdkfont.c (gdk_font_get_type): + * gdk/gdkevents.c (gdk_event_get_type): + * gdk/gdkdraw.c (gdk_drawable_get_type): + * gdk/gdkdisplaymanager.c (gdk_display_manager_get_type): + * gdk/gdkdisplay.c (gdk_display_get_type): + * gdk/gdkcursor.c (gdk_cursor_get_type): + * gdk/gdkcolor.c (gdk_color_get_type): Intern type names before + registering the type to avoid unnecessary copies. + + * configure.in: Require GLib 2.9.0 + 2005-08-31 Matthias Clasen * gtk/gtktoolbar.c: Undeprecate gtk_toolbar_set_icon_size(), diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9840704066..fbf0b34182 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,32 @@ +2005-08-31 Matthias Clasen + + * gdk/x11/gdkwindow-x11.c (gdk_window_impl_x11_get_type): + * gdk/x11/gdkscreen-x11.c (_gdk_screen_x11_get_type): + * gdk/x11/gdkpixmap-x11.c (gdk_pixmap_impl_x11_get_type): + * gdk/x11/gdkkeys-x11.c (gdk_keymap_x11_get_type): + * gdk/x11/gdkinput.c (gdk_device_get_type): + * gdk/x11/gdkimage-x11.c (gdk_image_get_type): + * gdk/x11/gdkgc-x11.c (_gdk_gc_x11_get_type): + * gdk/x11/gdkdrawable-x11.c (_gdk_drawable_impl_x11_get_type): + * gdk/x11/gdkdnd-x11.c (gdk_drag_context_get_type): + * gdk/x11/gdkdisplay-x11.c (_gdk_display_x11_get_type): + * gdk/x11/gdkcolor-x11.c (gdk_colormap_get_type): + * gdk/gdkwindow.c (gdk_window_object_get_type): + * gdk/gdkscreen.c (gdk_screen_get_type): + * gdk/gdkrectangle.c (gdk_rectangle_get_type): + * gdk/gdkpixmap.c (gdk_pixmap_get_type): + * gdk/gdkkeys.c (gdk_keymap_get_type): + * gdk/gdkfont.c (gdk_font_get_type): + * gdk/gdkevents.c (gdk_event_get_type): + * gdk/gdkdraw.c (gdk_drawable_get_type): + * gdk/gdkdisplaymanager.c (gdk_display_manager_get_type): + * gdk/gdkdisplay.c (gdk_display_get_type): + * gdk/gdkcursor.c (gdk_cursor_get_type): + * gdk/gdkcolor.c (gdk_color_get_type): Intern type names before + registering the type to avoid unnecessary copies. + + * configure.in: Require GLib 2.9.0 + 2005-08-31 Matthias Clasen * gtk/gtktoolbar.c: Undeprecate gtk_toolbar_set_icon_size(), diff --git a/gdk/gdkcolor.c b/gdk/gdkcolor.c index d2a4a55cab..25b600ea29 100644 --- a/gdk/gdkcolor.c +++ b/gdk/gdkcolor.c @@ -314,7 +314,7 @@ gdk_color_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static ("GdkColor", + our_type = g_boxed_type_register_static (g_intern_static_string ("GdkColor"), (GBoxedCopyFunc)gdk_color_copy, (GBoxedFreeFunc)gdk_color_free); return our_type; diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index 1038d73479..23cb952576 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -36,7 +36,7 @@ gdk_cursor_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static ("GdkCursor", + our_type = g_boxed_type_register_static (g_intern_static_string ("GdkCursor"), (GBoxedCopyFunc)gdk_cursor_ref, (GBoxedFreeFunc)gdk_cursor_unref); return our_type; diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index 463c98e9f2..986fcdf25d 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -107,7 +107,7 @@ gdk_display_get_type (void) (GInstanceInitFunc) gdk_display_init }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkDisplay", &object_info, 0); + g_intern_static_string ("GdkDisplay"), &object_info, 0); } return object_type; diff --git a/gdk/gdkdisplaymanager.c b/gdk/gdkdisplaymanager.c index 157bcf42c4..ca603624ea 100644 --- a/gdk/gdkdisplaymanager.c +++ b/gdk/gdkdisplaymanager.c @@ -88,7 +88,7 @@ gdk_display_manager_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkDisplayManager", + g_intern_static_string ("GdkDisplayManager"), &object_info, 0); } diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c index 116b02965a..024215e571 100644 --- a/gdk/gdkdraw.c +++ b/gdk/gdkdraw.c @@ -85,7 +85,7 @@ gdk_drawable_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkDrawable", + g_intern_static_string ("GdkDrawable"), &object_info, G_TYPE_FLAG_ABSTRACT); } diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index bcafbde956..040ebc292f 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -1200,7 +1200,7 @@ gdk_event_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static ("GdkEvent", + our_type = g_boxed_type_register_static (g_intern_static_string ("GdkEvent"), (GBoxedCopyFunc)gdk_event_copy, (GBoxedFreeFunc)gdk_event_free); return our_type; diff --git a/gdk/gdkfont.c b/gdk/gdkfont.c index dd90c975d8..f549cbdce4 100644 --- a/gdk/gdkfont.c +++ b/gdk/gdkfont.c @@ -38,7 +38,7 @@ gdk_font_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static ("GdkFont", + our_type = g_boxed_type_register_static (g_intern_static_string ("GdkFont"), (GBoxedCopyFunc)gdk_font_ref, (GBoxedFreeFunc)gdk_font_unref); return our_type; diff --git a/gdk/gdkkeys.c b/gdk/gdkkeys.c index 754dee38c2..cc48623e82 100644 --- a/gdk/gdkkeys.c +++ b/gdk/gdkkeys.c @@ -61,7 +61,7 @@ gdk_keymap_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkKeymap", + g_intern_static_string ("GdkKeymap"), &object_info, 0); } diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c index 06021e60c8..9c2d1100f3 100644 --- a/gdk/gdkpixmap.c +++ b/gdk/gdkpixmap.c @@ -180,7 +180,7 @@ gdk_pixmap_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_DRAWABLE, - "GdkPixmap", + g_intern_static_string ("GdkPixmap"), &object_info, 0); } diff --git a/gdk/gdkrectangle.c b/gdk/gdkrectangle.c index d79bdf6b1e..649521a32c 100644 --- a/gdk/gdkrectangle.c +++ b/gdk/gdkrectangle.c @@ -99,7 +99,7 @@ gdk_rectangle_get_type (void) static GType our_type = 0; if (our_type == 0) - our_type = g_boxed_type_register_static ("GdkRectangle", + our_type = g_boxed_type_register_static (g_intern_static_string ("GdkRectangle"), (GBoxedCopyFunc)gdk_rectangle_copy, (GBoxedFreeFunc)g_free); return our_type; diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c index 949a9d22ea..94c4f96eb7 100644 --- a/gdk/gdkscreen.c +++ b/gdk/gdkscreen.c @@ -80,7 +80,7 @@ gdk_screen_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkScreen", &object_info, 0); + g_intern_static_string ("GdkScreen"), &object_info, 0); } return object_type; diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 999d4192cd..186d85d928 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -215,7 +215,7 @@ gdk_window_object_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_DRAWABLE, - "GdkWindow", + g_intern_static_string ("GdkWindow"), &object_info, 0); } diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c index 95fffe82b7..35dcb6fdf8 100644 --- a/gdk/x11/gdkcolor-x11.c +++ b/gdk/x11/gdkcolor-x11.c @@ -93,7 +93,7 @@ gdk_colormap_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkColormap", + g_intern_static_string ("GdkColormap"), &object_info, 0); } diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 133909dd2f..80cafbf135 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -115,7 +115,7 @@ _gdk_display_x11_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_DISPLAY, - "GdkDisplayX11", + g_intern_static_string ("GdkDisplayX11"), &object_info, 0); } diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 41598615b2..15e66e18c3 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -166,7 +166,7 @@ gdk_drag_context_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkDragContext", + g_intern_static_string ("GdkDragContext"), &object_info, 0); } diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c index 49ab08f61f..ff0441b29e 100644 --- a/gdk/x11/gdkdrawable-x11.c +++ b/gdk/x11/gdkdrawable-x11.c @@ -167,7 +167,7 @@ _gdk_drawable_impl_x11_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_DRAWABLE, - "GdkDrawableImplX11", + g_intern_static_string ("GdkDrawableImplX11"), &object_info, 0); } diff --git a/gdk/x11/gdkgc-x11.c b/gdk/x11/gdkgc-x11.c index 2d0fe34a7b..308a31cbdf 100644 --- a/gdk/x11/gdkgc-x11.c +++ b/gdk/x11/gdkgc-x11.c @@ -80,7 +80,7 @@ _gdk_gc_x11_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_GC, - "GdkGCX11", + g_intern_static_string ("GdkGCX11"), &object_info, 0); } diff --git a/gdk/x11/gdkimage-x11.c b/gdk/x11/gdkimage-x11.c index d6ca243395..4b836e5679 100644 --- a/gdk/x11/gdkimage-x11.c +++ b/gdk/x11/gdkimage-x11.c @@ -97,7 +97,7 @@ gdk_image_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkImage", + g_intern_static_string ("GdkImage"), &object_info, 0); } diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c index f1c7f73647..574e701d69 100644 --- a/gdk/x11/gdkinput.c +++ b/gdk/x11/gdkinput.c @@ -84,7 +84,7 @@ gdk_device_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkDevice", + g_intern_static_string ("GdkDevice"), &object_info, 0); } diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c index 42e5b4a64a..6539e79fff 100644 --- a/gdk/x11/gdkkeys-x11.c +++ b/gdk/x11/gdkkeys-x11.c @@ -126,7 +126,7 @@ gdk_keymap_x11_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_KEYMAP, - "GdkKeymapX11", + g_intern_static_string ("GdkKeymapX11"), &object_info, 0); } diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index 540d9ac30b..0fdf895eb8 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -87,7 +87,7 @@ gdk_pixmap_impl_x11_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_DRAWABLE_IMPL_X11, - "GdkPixmapImplX11", + g_intern_static_string ("GdkPixmapImplX11"), &object_info, 0); } diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 1dbff67c2e..7f2a2a5a38 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -80,7 +80,7 @@ _gdk_screen_x11_get_type (void) (GInstanceInitFunc) NULL, }; object_type = g_type_register_static (GDK_TYPE_SCREEN, - "GdkScreenX11", + g_intern_static_string ("GdkScreenX11"), &object_info, 0); } return object_type; diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c index b796407986..fc10ab1233 100644 --- a/gdk/x11/gdkvisual-x11.c +++ b/gdk/x11/gdkvisual-x11.c @@ -97,7 +97,7 @@ gdk_visual_get_type (void) }; object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkVisual", + g_intern_static_string ("GdkVisual"), &object_info, 0); } diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 5d2f5bc02b..3ef562f7e7 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -136,7 +136,7 @@ gdk_window_impl_x11_get_type (void) }; object_type = g_type_register_static (GDK_TYPE_DRAWABLE_IMPL_X11, - "GdkWindowImplX11", + g_intern_static_string ("GdkWindowImplX11"), &object_info, 0); }