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 <thiago.macieira@intel.com>
bb10
Marc Mutz 2022-02-07 16:32:29 +01:00
parent 69e445721c
commit d04d571d3a
1 changed files with 1 additions and 1 deletions

View File

@ -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!