* mu-util: forward-port the MacOS/g_slice workaround

This commit is contained in:
Dirk-Jan C. Binnema
2011-08-29 23:40:34 +03:00
parent 9dc4bd24df
commit 978c94a2ba

View File

@ -157,15 +157,19 @@ mu_util_init_system (void)
* terms) won't work */ * terms) won't work */
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
/* on FreeBSD, it seems g_slice_new and friends lead to /* on FreeBSD, it seems g_slice_new and friends lead to
* segfaults. So we shut if off */ * segfaults. Same for MacOS. We cannot easily debug what is
#ifdef __FreeBSD__ * going on there (no access to such a system), so all we can
if (!g_setenv ("G_SLICE", "always-malloc", TRUE)) { * do is add a lame fallback -> we let g_slice_* use normal
g_critical ("cannot set G_SLICE"); * malloc
return FALSE; */
} #ifndef __linux__
MU_WRITE_LOG("setting G_SLICE to always-malloc"); if (!g_setenv ("G_SLICE", "always-malloc", TRUE)) {
#endif /*__FreeBSD__*/ g_critical ("cannot set G_SLICE");
return FALSE;
}
/* g_debug ("setting G_SLICE to always-malloc"); */
#endif /*!__linux__*/
g_type_init (); g_type_init ();