From d04d571d3a58f12cd173bde3fa8694875966efad Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 7 Feb 2022 16:32:29 +0100 Subject: [PATCH] QEventDispatcher/GLib: avoid three relocations This string table is small, so instead of using qOffsetStringArray(), just don't make it static. The compiler will do it's thing, then, without introducing relocations. Proof: $ ~/bin/relinfo.pl libQt6Core.so.6.4.0 libQt6Core.so.6.4.0: 6303 relocations, 5346 relative (84%), 318 PLT entries, 1 for local syms (0%), 0 users vs. $ ~/bin/relinfo.pl libQt6Core.so.6.4.0 libQt6Core.so.6.4.0: 6300 relocations, 5343 relative (84%), 318 PLT entries, 1 for local syms (0%), 0 users Task-number: QTBUG-100536 Pick-to: 6.3 6.2 Change-Id: I7f5c3c127867c9baebfb270ef3e257dd818f821a Reviewed-by: Thiago Macieira --- src/corelib/kernel/qeventdispatcher_glib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index 3964c1ceac..974ce7f5e1 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -82,7 +82,7 @@ static gboolean socketNotifierSourceCheck(GSource *source) if (p->pollfd.revents & G_IO_NVAL) { // disable the invalid socket notifier - static const char *t[] = { "Read", "Write", "Exception" }; + const char * const t[] = { "Read", "Write", "Exception" }; qWarning("QSocketNotifier: Invalid socket %d and type '%s', disabling...", p->pollfd.fd, t[int(p->socketNotifier->type())]); // ### note, modifies src->pollfds!