linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / glib / quark_init_on_demand.patch
blob168086484314f2ca623851dbab1757230f9f52d7
1 --- glib-source/glib/gquark.c 2016-08-17 17:20:47.000000000 +0200
2 +++ glib-source/glib/gquark.c 2016-08-30 07:49:13.298234757 +0200
3 @@ -57,6 +57,9 @@
4 void
5 g_quark_init (void)
7 + if (quark_ht)
8 + return;
10 g_assert (quark_seq_id == 0);
11 quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
12 quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
13 @@ -138,9 +141,12 @@
14 return 0;
16 G_LOCK (quark_global);
17 +#if !defined(__GLIBC__)
18 + g_quark_init ();
19 +#endif
20 quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
21 G_UNLOCK (quark_global);
23 return quark;
26 @@ -280,6 +286,7 @@
27 GQuark quark;
28 gchar **quarks_new;
30 + g_quark_init ();
31 if (quark_seq_id % QUARK_BLOCK_SIZE == 0)
33 quarks_new = g_new (gchar*, quark_seq_id + QUARK_BLOCK_SIZE);