[glib] gsignal: Use new G_VALUE_COLLECT_INIT variant
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glib] gsignal: Use new G_VALUE_COLLECT_INIT variant
- Date: Wed, 13 Jan 2010 09:24:55 +0000 (UTC)
commit 0f25115ffc887110993f6947f9907a85374933d3
Author: Edward Hervey <bilboed bilboed com>
Date: Wed Dec 2 11:49:49 2009 +0100
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
gobject/gsignal.c | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index d69b880..9004ee8 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]