aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/glib/files/2.56.2-quark_init_on_demand.patch')
-rw-r--r--dev-libs/glib/files/2.56.2-quark_init_on_demand.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/dev-libs/glib/files/2.56.2-quark_init_on_demand.patch b/dev-libs/glib/files/2.56.2-quark_init_on_demand.patch
new file mode 100644
index 00000000..d93f85c6
--- /dev/null
+++ b/dev-libs/glib/files/2.56.2-quark_init_on_demand.patch
@@ -0,0 +1,50 @@
+--- a/glib/gquark.c
++++ b/glib/gquark.c
+@@ -57,6 +57,9 @@
+ void
+ g_quark_init (void)
+ {
++ if (quark_ht)
++ return;
++
+ g_assert (quark_seq_id == 0);
+ quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
+ quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
+@@ -138,6 +141,9 @@
+ return 0;
+
+ G_LOCK (quark_global);
++#if !defined(__GLIBC__)
++ g_quark_init ();
++#endif
+ quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
+ G_UNLOCK (quark_global);
+
+@@ -200,6 +206,9 @@
+ return 0;
+
+ G_LOCK (quark_global);
++#if !defined(__GLIBC__)
++ g_quark_init ();
++#endif
+ quark = quark_from_string (string, duplicate);
+ G_UNLOCK (quark_global);
+
+@@ -278,6 +287,7 @@
+ GQuark quark;
+ gchar **quarks_new;
+
++ g_quark_init ();
+ if (quark_seq_id % QUARK_BLOCK_SIZE == 0)
+ {
+ quarks_new = g_new (gchar*, quark_seq_id + QUARK_BLOCK_SIZE);
+@@ -310,6 +320,9 @@
+ return NULL;
+
+ G_LOCK (quark_global);
++#if !defined(__GLIBC__)
++ g_quark_init ();
++#endif
+ quark = quark_from_string (string, duplicate);
+ result = quarks[quark];
+ G_UNLOCK (quark_global);