Kaydet (Commit) 006d30b1 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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
üst 262b5e0b
...@@ -35,7 +35,11 @@ AllocMode alloc_mode = AMode_UNSET; ...@@ -35,7 +35,11 @@ AllocMode alloc_mode = AMode_UNSET;
static void determine_alloc_mode() static void determine_alloc_mode()
{ {
assert(alloc_mode == AMode_UNSET); 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;
} }
/* ================================================================= * /* ================================================================= *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment