diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-09-28 08:16:11 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-09-28 08:17:53 +0200 |
commit | 006d30b1a29e2c471a96c0f4658beea8cb86b338 (patch) | |
tree | 4591bbd63f5617a14ef42c21b799ed920964f655 /sal | |
parent | 262b5e0b3e870ea51c590de8d6cc34111c34ad0f (diff) |
by default use the system memory allocator
Anything except an unset G_SLICE or the value always-malloc results in
the custom allocator. We might revert that change if it causes issues
but currentlz it looks like our custom allocator performs quite badly in
some situations.
Change-Id: Ib867f7ba0de4d599aa045c28aaab9b644d619beb
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/alloc_global.cxx | 6 |
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; } /* ================================================================= * |