summaryrefslogtreecommitdiff
path: root/gobject
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-12-02 11:49:49 +0100
committerAlexander Larsson <alexl@redhat.com>2010-01-13 10:16:48 +0100
commit0f25115ffc887110993f6947f9907a85374933d3 (patch)
treeda210766ddcae4b5fd04a690e1abbb4e01500381 /gobject
parent546fc0ca331c8d1b3393fe218a697b6a1a1c1072 (diff)
gsignal: Use new G_VALUE_COLLECT_INIT variant
Makes g_signal_emit_valist from 15% to 20% faster. Results reported from profiling the pan newsreader which uses a variant of simple and complex signal emissions (i.e no args or various args) https://bugzilla.gnome.org/show_bug.cgi?id=603590
Diffstat (limited to 'gobject')
-rw-r--r--gobject/gsignal.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index d69b880cf..9004ee833 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -1980,13 +1980,11 @@ g_signal_chain_from_overridden_handler (gpointer instance,
GType ptype = node->param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE;
gboolean static_scope = node->param_types[i] & G_SIGNAL_TYPE_STATIC_SCOPE;
- param_values[i].g_type = 0;
SIGNAL_UNLOCK ();
- g_value_init (param_values + i, ptype);
- G_VALUE_COLLECT (param_values + i,
- var_args,
- static_scope ? G_VALUE_NOCOPY_CONTENTS : 0,
- &error);
+ G_VALUE_COLLECT_INIT (param_values + i, ptype,
+ var_args,
+ static_scope ? G_VALUE_NOCOPY_CONTENTS : 0,
+ &error);
if (error)
{
g_warning ("%s: %s", G_STRLOC, error);
@@ -2949,13 +2947,11 @@ g_signal_emit_valist (gpointer instance,
GType ptype = node->param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE;
gboolean static_scope = node->param_types[i] & G_SIGNAL_TYPE_STATIC_SCOPE;
- param_values[i].g_type = 0;
SIGNAL_UNLOCK ();
- g_value_init (param_values + i, ptype);
- G_VALUE_COLLECT (param_values + i,
- var_args,
- static_scope ? G_VALUE_NOCOPY_CONTENTS : 0,
- &error);
+ G_VALUE_COLLECT_INIT (param_values + i, ptype,
+ var_args,
+ static_scope ? G_VALUE_NOCOPY_CONTENTS : 0,
+ &error);
if (error)
{
g_warning ("%s: %s", G_STRLOC, error);