gtk+ r20761 - in trunk: . gtk



Author: mitch
Date: Fri Jul  4 14:27:40 2008
New Revision: 20761
URL: http://svn.gnome.org/viewvc/gtk+?rev=20761&view=rev

Log:
2008-07-04  Michael Natterer  <mitch imendio com>

	Allocate with GSlice:

	* gtk/gtkassistant.c: GtkAssistantPage
	* gtk/gtkcellview.c: GtkCellViewCellInfo
	* gtk/gtkentry.c: GtkEntryPasswordHint, PopupInfo
	* gtk/gtkfilefilter.c: FilterRule
	* gtk/gtknotebook.c: GtkNotebookPage



Modified:
   trunk/ChangeLog
   trunk/gtk/gtkassistant.c
   trunk/gtk/gtkcellview.c
   trunk/gtk/gtkentry.c
   trunk/gtk/gtkfilefilter.c
   trunk/gtk/gtknotebook.c

Modified: trunk/gtk/gtkassistant.c
==============================================================================
--- trunk/gtk/gtkassistant.c	(original)
+++ trunk/gtk/gtkassistant.c	Fri Jul  4 14:27:40 2008
@@ -892,7 +892,7 @@
     g_object_unref (page_info->sidebar_image);
 
   gtk_widget_destroy (page_info->title);
-  g_free (page_info);
+  g_slice_free (GtkAssistantPage, page_info);
   g_list_free_1 (element);
 }
 
@@ -1650,7 +1650,7 @@
 
   priv = assistant->priv;
 
-  page_info = g_new0 (GtkAssistantPage, 1);
+  page_info = g_slice_new0 (GtkAssistantPage);
   page_info->page  = page;
   page_info->title = gtk_label_new (NULL);
 

Modified: trunk/gtk/gtkcellview.c
==============================================================================
--- trunk/gtk/gtkcellview.c	(original)
+++ trunk/gtk/gtkcellview.c	Fri Jul  4 14:27:40 2008
@@ -589,7 +589,7 @@
 
   g_object_ref_sink (renderer);
 
-  info = g_new0 (GtkCellViewCellInfo, 1);
+  info = g_slice_new0 (GtkCellViewCellInfo);
   info->cell = renderer;
   info->expand = expand ? TRUE : FALSE;
   info->pack = GTK_PACK_START;
@@ -609,7 +609,7 @@
 
   g_object_ref_sink (renderer);
 
-  info = g_new0 (GtkCellViewCellInfo, 1);
+  info = g_slice_new0 (GtkCellViewCellInfo);
   info->cell = renderer;
   info->expand = expand ? TRUE : FALSE;
   info->pack = GTK_PACK_END;
@@ -646,7 +646,7 @@
 
       gtk_cell_view_cell_layout_clear_attributes (layout, info->cell);
       g_object_unref (info->cell);
-      g_free (info);
+      g_slice_free (GtkCellViewCellInfo, info);
       cellview->priv->cell_list = g_list_delete_link (cellview->priv->cell_list, 
 						      cellview->priv->cell_list);
     }

Modified: trunk/gtk/gtkentry.c
==============================================================================
--- trunk/gtk/gtkentry.c	(original)
+++ trunk/gtk/gtkentry.c	Fri Jul  4 14:27:40 2008
@@ -2500,7 +2500,7 @@
   if (password_hint->password_hint_timeout_id)
     g_source_remove (password_hint->password_hint_timeout_id);
 
-  g_free (password_hint);
+  g_slice_free (GtkEntryPasswordHint, password_hint);
 }
 
 /* Default signal handlers
@@ -2598,7 +2598,7 @@
 
           if (!password_hint)
             {
-              password_hint = g_new0 (GtkEntryPasswordHint, 1);
+              password_hint = g_slice_new0 (GtkEntryPasswordHint);
               g_object_set_qdata_full (G_OBJECT (entry), quark_password_hint,
                                        password_hint,
                                        (GDestroyNotify) gtk_entry_password_hint_free);
@@ -5420,14 +5420,14 @@
     }
 
   g_object_unref (entry);
-  g_free (info);
+  g_slice_free (PopupInfo, info);
 }
 			
 static void
 gtk_entry_do_popup (GtkEntry       *entry,
                     GdkEventButton *event)
 {
-  PopupInfo *info = g_new (PopupInfo, 1);
+  PopupInfo *info = g_slice_new (PopupInfo);
 
   /* In order to know what entries we should make sensitive, we
    * ask for the current targets of the clipboard, and when

Modified: trunk/gtk/gtkfilefilter.c
==============================================================================
--- trunk/gtk/gtkfilefilter.c	(original)
+++ trunk/gtk/gtkfilefilter.c	Fri Jul  4 14:27:40 2008
@@ -113,7 +113,7 @@
       g_assert_not_reached ();
     }
 
-  g_free (rule);
+  g_slice_free (FilterRule, rule);
 }
 
 static void
@@ -222,7 +222,7 @@
   g_return_if_fail (GTK_IS_FILE_FILTER (filter));
   g_return_if_fail (mime_type != NULL);
 
-  rule = g_new (FilterRule, 1);
+  rule = g_slice_new (FilterRule);
   rule->type = FILTER_RULE_MIME_TYPE;
   rule->needed = GTK_FILE_FILTER_MIME_TYPE;
   rule->u.mime_type = g_strdup (mime_type);
@@ -248,7 +248,7 @@
   g_return_if_fail (GTK_IS_FILE_FILTER (filter));
   g_return_if_fail (pattern != NULL);
 
-  rule = g_new (FilterRule, 1);
+  rule = g_slice_new (FilterRule);
   rule->type = FILTER_RULE_PATTERN;
   rule->needed = GTK_FILE_FILTER_DISPLAY_NAME;
   rule->u.pattern = g_strdup (pattern);
@@ -272,7 +272,7 @@
   
   g_return_if_fail (GTK_IS_FILE_FILTER (filter));
 
-  rule = g_new (FilterRule, 1);
+  rule = g_slice_new (FilterRule);
   rule->type = FILTER_RULE_PIXBUF_FORMATS;
   rule->needed = GTK_FILE_FILTER_MIME_TYPE;
   rule->u.pixbuf_formats = gdk_pixbuf_get_formats ();
@@ -310,7 +310,7 @@
   g_return_if_fail (GTK_IS_FILE_FILTER (filter));
   g_return_if_fail (func != NULL);
 
-  rule = g_new (FilterRule, 1);
+  rule = g_slice_new (FilterRule);
   rule->type = FILTER_RULE_CUSTOM;
   rule->needed = needed;
   rule->u.custom.func = func;

Modified: trunk/gtk/gtknotebook.c
==============================================================================
--- trunk/gtk/gtknotebook.c	(original)
+++ trunk/gtk/gtknotebook.c	Fri Jul  4 14:27:40 2008
@@ -4044,7 +4044,7 @@
 
   gtk_widget_freeze_child_notify (child);
 
-  page = g_new0 (GtkNotebookPage, 1);
+  page = g_slice_new0 (GtkNotebookPage);
   page->child = child;
 
   nchildren = g_list_length (notebook->children);
@@ -4387,7 +4387,7 @@
       page->last_focus_child = NULL;
     }
   
-  g_free (page);
+  g_slice_free (GtkNotebookPage, page);
 
   gtk_notebook_update_labels (notebook);
   if (need_resize)



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