* mu-util.c: use G_SLICE=always-malloc for all non-Linux systems

apparently, g_slice_* have problems on MacOS, like seen on FreeBSD before. So for now,
  we just fallback to normal malloc on those system. Not sure if this is a bug in g_slice
  or something mu. Until we find the reason, we'll shut off g_slice so at least we
  avoid crashes at the price of some efficiency.
This commit is contained in:
Dirk-Jan C. Binnema 2011-08-22 23:44:06 +03:00
parent 1e003b44b0
commit 3582f414ff
1 changed files with 8 additions and 4 deletions

View File

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