mirror of https://github.com/djcb/mu.git
* 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:
parent
1e003b44b0
commit
3582f414ff
|
@ -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 ();
|
||||
|
||||
|
|
Loading…
Reference in New Issue