[gjs/wip/nielsdg/signal-marshaller] Don't pass generic marshaller to g_signal_newv()
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/nielsdg/signal-marshaller] Don't pass generic marshaller to g_signal_newv()
- Date: Thu, 26 Sep 2019 08:34:48 +0000 (UTC)
commit d64200548a9ed91dd0a1be0de23e31f6671578fb
Author: Niels De Graef <niels degraef barco 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]