diff --git a/ChangeLog b/ChangeLog index 419e5c4dc8..e43dce19ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Sep 21 07:44:30 1998 Tim Janik + + * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate + the required memory block, rather than allocating it newly from + scratch and doing a full-blown block copy on it. + Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 419e5c4dc8..e43dce19ed 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Mon Sep 21 07:44:30 1998 Tim Janik + + * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate + the required memory block, rather than allocating it newly from + scratch and doing a full-blown block copy on it. + Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 419e5c4dc8..e43dce19ed 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Mon Sep 21 07:44:30 1998 Tim Janik + + * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate + the required memory block, rather than allocating it newly from + scratch and doing a full-blown block copy on it. + Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 419e5c4dc8..e43dce19ed 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Mon Sep 21 07:44:30 1998 Tim Janik + + * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate + the required memory block, rather than allocating it newly from + scratch and doing a full-blown block copy on it. + Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 419e5c4dc8..e43dce19ed 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Mon Sep 21 07:44:30 1998 Tim Janik + + * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate + the required memory block, rather than allocating it newly from + scratch and doing a full-blown block copy on it. + Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 419e5c4dc8..e43dce19ed 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Mon Sep 21 07:44:30 1998 Tim Janik + + * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate + the required memory block, rather than allocating it newly from + scratch and doing a full-blown block copy on it. + Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 419e5c4dc8..e43dce19ed 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Mon Sep 21 07:44:30 1998 Tim Janik + + * gtk/gtkobject.c (gtk_object_class_add_signals): reallocate + the required memory block, rather than allocating it newly from + scratch and doing a full-blown block copy on it. + Mon Sep 21 02:30:06 1998 Tim Janik * NEWS file update for upcoming release of Gtk+ version 1.1.2, diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c index af023f0c38..6639830a25 100644 --- a/gtk/gtkobject.c +++ b/gtk/gtkobject.c @@ -127,7 +127,7 @@ gtk_object_get_type (void) static void gtk_object_base_class_init (GtkObjectClass *class) { - /* reset instance specific fields that don't get inhrited */ + /* reset instance specific fields that don't get inherited */ class->signals = NULL; class->nsignals = 0; class->n_args = 0; @@ -327,19 +327,13 @@ gtk_object_class_add_signals (GtkObjectClass *class, guint *signals, guint nsignals) { - guint *new_signals; - guint i; - - g_return_if_fail (class != NULL); - - new_signals = g_new (guint, class->nsignals + nsignals); - for (i = 0; i < class->nsignals; i++) - new_signals[i] = class->signals[i]; - for (i = 0; i < nsignals; i++) - new_signals[class->nsignals + i] = signals[i]; - - g_free (class->signals); - class->signals = new_signals; + g_return_if_fail (GTK_IS_OBJECT_CLASS (class)); + if (!nsignals) + return; + g_return_if_fail (signals != NULL); + + class->signals = g_renew (guint, class->signals, class->nsignals + nsignals); + memcpy (class->signals + class->nsignals, signals, nsignals * sizeof (guint)); class->nsignals += nsignals; }