mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-25 02:18:55 +02:00
gsignal: Canonicalise signal names at installation time
Rather than adding a canonicalised and non-canonicalised version of the signal to `g_signal_key_bsa`, just add the canonicalised version. Signal lookups always use the canonicalised key (since the previous commit). This saves space in `g_signal_key_bsa`, which should speed up lookups; and it saves significant space in the global `GQuark` table (a 9.6% reduction in entries in that table, by a rough test using gnome-software). We have to be a little more relaxed on the signal name validation than we are for property name validation, as GTK installs a `-gtk-private-changed` signal which violates the signal naming rules. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@@ -180,7 +180,8 @@ test_class_init (TestClass *klass)
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
simple2_id = g_signal_new ("simple-2",
|
||||
/* Deliberately install this one in non-canonical form to check that’s handled correctly: */
|
||||
simple2_id = g_signal_new ("simple_2",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE,
|
||||
0,
|
||||
|
Reference in New Issue
Block a user