[gjs/wip/nielsdg/signal-marshaller] Don't pass generic marshaller to g_signal_newv()



commit 48bd015d0a7fbdc96327e2f70c673f0f58fdadd8
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Thu Sep 26 10:09:55 2019 +0200

    Don't pass generic marshaller to g_signal_newv()
    
    By passing NULL to `g_signal_newv`, GLib will do an attempt to
    internally optimize the marshalling by setting one of the default
    marshallers in GLib (and its valist variant), which is a little bit
    faster than the regular marshalling using `GValue` and libffi.
    
    So, by passing NULL, we can get a little performance bump.

 gi/private.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gi/private.cpp b/gi/private.cpp
index d537b617..26f8e02e 100644
--- a/gi/private.cpp
+++ b/gi/private.cpp
@@ -404,7 +404,7 @@ static bool gjs_signal_new(JSContext* cx, unsigned argc, JS::Value* vp) {
     unsigned signal_id = g_signal_newv(
         signal_name.get(), gtype, GSignalFlags(flags),
         /* class closure */ nullptr, accumulator, /* accu_data */ nullptr,
-        g_cclosure_marshal_generic, return_type, n_parameters, params);
+        /* c_marshaller */ nullptr, return_type, n_parameters, params);
 
     // FIXME: what if ID is greater than int32 max?
     args.rval().setInt32(signal_id);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]