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
This commit is contained in:
Edward Hervey
2009-12-02 11:49:49 +01:00
committed by Alexander Larsson
parent 546fc0ca33
commit 0f25115ffc

View File

@@ -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);