summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-03-03 21:36:10 +0100
committerAlexander Larsson <alexl@redhat.com>2012-03-03 21:36:10 +0100
commit2d6502f67bb207c5a0d6eaba27b2398b74baa28f (patch)
tree87b746457ab68993e4faef4b23b4d77300f31ec7
parentb05ea89d0c9e97fcd7858a83ea0d1c6d7fe1972f (diff)
downloadglib-signal-performance.tar.gz
fastpath: Do allow NO_RECURSE fastpath for NOP emissionssignal-performance
This fixes a performance regression wrt the old NOP emission handler.
-rw-r--r--gobject/gsignal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index 14054b508..09c619539 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -701,7 +701,7 @@ node_update_single_va_closure (SignalNode *node)
/* Fast path single-handler without boxing the arguments in GValues */
if (G_TYPE_IS_OBJECT (node->itype) &&
- (node->flags & (G_SIGNAL_NO_RECURSE|G_SIGNAL_MUST_COLLECT)) == 0 &&
+ (node->flags & (G_SIGNAL_MUST_COLLECT)) == 0 &&
(node->emission_hooks == NULL || node->emission_hooks->hooks == NULL))
{
GSignalFlags run_type;
@@ -3158,6 +3158,11 @@ g_signal_emit_valist (gpointer instance,
return;
}
+ /* Don't allow no-recurse emission as we might have to restart, which means
+ we will run multiple handlers and thus must ref all arguments */
+ if (closure != NULL && node->flags & (G_SIGNAL_NO_RECURSE) != 0)
+ fastpath = FALSE;
+
if (fastpath)
{
SignalAccumulator *accumulator;