From da4da16bafdc84a6b6c8a534de311a1b118b86b6 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 4 Jul 2008 14:27:40 +0000 Subject: [PATCH] Allocate with GSlice: 2008-07-04 Michael Natterer Allocate with GSlice: * gtk/gtkassistant.c: GtkAssistantPage * gtk/gtkcellview.c: GtkCellViewCellInfo * gtk/gtkentry.c: GtkEntryPasswordHint, PopupInfo * gtk/gtkfilefilter.c: FilterRule * gtk/gtknotebook.c: GtkNotebookPage svn path=/trunk/; revision=20761 --- ChangeLog | 10 ++++++++++ gtk/gtkassistant.c | 4 ++-- gtk/gtkcellview.c | 6 +++--- gtk/gtkentry.c | 8 ++++---- gtk/gtkfilefilter.c | 10 +++++----- gtk/gtknotebook.c | 4 ++-- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 855d7ebd60..9212ca0eae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-07-04 Michael Natterer + + Allocate with GSlice: + + * gtk/gtkassistant.c: GtkAssistantPage + * gtk/gtkcellview.c: GtkCellViewCellInfo + * gtk/gtkentry.c: GtkEntryPasswordHint, PopupInfo + * gtk/gtkfilefilter.c: FilterRule + * gtk/gtknotebook.c: GtkNotebookPage + 2008-07-04 Michael Natterer * gtk/gtkcombobox.c: allocate ComboCellInfo with GSlice. diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c index 289718df43..1410132861 100644 --- a/gtk/gtkassistant.c +++ b/gtk/gtkassistant.c @@ -892,7 +892,7 @@ remove_page (GtkAssistant *assistant, 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 @@ gtk_assistant_insert_page (GtkAssistant *assistant, 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); diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c index 4c1e83ae6e..dab19cb8d0 100644 --- a/gtk/gtkcellview.c +++ b/gtk/gtkcellview.c @@ -589,7 +589,7 @@ gtk_cell_view_cell_layout_pack_start (GtkCellLayout *layout, 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 @@ gtk_cell_view_cell_layout_pack_end (GtkCellLayout *layout, 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 (GtkCellLayout *layout) 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); } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 0abd6803ac..59b1ca4c16 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -2500,7 +2500,7 @@ gtk_entry_password_hint_free (GtkEntryPasswordHint *password_hint) 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 @@ gtk_entry_real_insert_text (GtkEditable *editable, 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 @@ popup_targets_received (GtkClipboard *clipboard, } 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 diff --git a/gtk/gtkfilefilter.c b/gtk/gtkfilefilter.c index 6738fc3fbe..bb37078bc4 100644 --- a/gtk/gtkfilefilter.c +++ b/gtk/gtkfilefilter.c @@ -113,7 +113,7 @@ filter_rule_free (FilterRule *rule) g_assert_not_reached (); } - g_free (rule); + g_slice_free (FilterRule, rule); } static void @@ -222,7 +222,7 @@ gtk_file_filter_add_mime_type (GtkFileFilter *filter, 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 @@ gtk_file_filter_add_pattern (GtkFileFilter *filter, 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 @@ gtk_file_filter_add_pixbuf_formats (GtkFileFilter *filter) 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 @@ gtk_file_filter_add_custom (GtkFileFilter *filter, 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; diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index d0f034cebe..be072c18d7 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -4044,7 +4044,7 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook, 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 @@ gtk_notebook_real_remove (GtkNotebook *notebook, page->last_focus_child = NULL; } - g_free (page); + g_slice_free (GtkNotebookPage, page); gtk_notebook_update_labels (notebook); if (need_resize)