Use the slice allocator for many small allocations.
2006-01-04 Matthias Clasen <mclasen@redhat.com> * gtk/gtkaccelmap.c: * gtk/gtkactiongroup.c: * gtk/gtkdialog.c: * gtk/gtkfilesystemunix.c: * gtk/gtkgc.c: * gtk/gtkkeyhash.c: * gtk/gtkplug.c: * gtk/gtktextiter.c: * gtk/gtktextlayout.c: * gtk/gtkuimanager.c: * gtk/gtkwidget.c: * gtk/gtkwindow.c: * gtk/gtkxembed.c: Use the slice allocator for many small allocations. * gtk/gtkcolorsel.c: * gtk/gtktreeview.c: Use IPN. * gtk/gtkwidget.c: Remove an unused field from the AccelPath struct.
This commit is contained in:
committed by
Matthias Clasen
parent
f827de4ec4
commit
04eceaf621
@ -532,6 +532,12 @@ gtk_dialog_new_with_buttons (const gchar *title,
|
||||
return GTK_WIDGET (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
response_data_free (gpointer data)
|
||||
{
|
||||
g_slice_free (ResponseData, data);
|
||||
}
|
||||
|
||||
static ResponseData*
|
||||
get_response_data (GtkWidget *widget,
|
||||
gboolean create)
|
||||
@ -541,12 +547,12 @@ get_response_data (GtkWidget *widget,
|
||||
|
||||
if (ad == NULL && create)
|
||||
{
|
||||
ad = g_new (ResponseData, 1);
|
||||
ad = g_slice_new (ResponseData);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (widget),
|
||||
I_("gtk-dialog-response-data"),
|
||||
ad,
|
||||
g_free);
|
||||
response_data_free);
|
||||
}
|
||||
|
||||
return ad;
|
||||
|
||||
Reference in New Issue
Block a user