summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/alloc_global.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sal/rtl/alloc_global.cxx b/sal/rtl/alloc_global.cxx
index 60dbc9c85b78..69610630f193 100644
--- a/sal/rtl/alloc_global.cxx
+++ b/sal/rtl/alloc_global.cxx
@@ -35,7 +35,11 @@ AllocMode alloc_mode = AMode_UNSET;
static void determine_alloc_mode()
{
assert(alloc_mode == AMode_UNSET);
- alloc_mode = (getenv("G_SLICE") == NULL ? AMode_CUSTOM : AMode_SYSTEM);
+ const char* alloc_string = getenv("G_SLICE");
+ if (!alloc_string)
+ alloc_mode = AMode_SYSTEM;
+ else
+ alloc_mode = strcmp(alloc_string, "always-malloc") == 0 ? AMode_SYSTEM : AMode_CUSTOM;
}
/* ================================================================= *