From bbca1cd8d96bde91cd14651cc114dff907d7ed73 Mon Sep 17 00:00:00 2001 From: daan Date: Thu, 31 Oct 2019 12:42:23 -0700 Subject: [PATCH] allow decommit by default --- src/options.c | 2 +- src/segment.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/options.c b/src/options.c index 31af819b..d5771705 100644 --- a/src/options.c +++ b/src/options.c @@ -60,7 +60,7 @@ static mi_option_desc_t options[_mi_option_last] = { 0, UNINIT, MI_OPTION(cache_reset) }, { 0, UNINIT, MI_OPTION(reset_decommits) }, // note: cannot enable this if secure is on { 0, UNINIT, MI_OPTION(eager_commit_delay) }, // the first N segments per thread are not eagerly committed - { 0, UNINIT, MI_OPTION(allow_decommit) }, // decommit pages when not eager committed + { 1, UNINIT, MI_OPTION(allow_decommit) }, // decommit pages when not eager committed { 0, UNINIT, MI_OPTION(segment_reset) }, // reset segment memory on free (needs eager commit) { 100, UNINIT, MI_OPTION(os_tag) } // only apple specific for now but might serve more or less related purpose }; diff --git a/src/segment.c b/src/segment.c index 41cf08d9..e88d22c5 100644 --- a/src/segment.c +++ b/src/segment.c @@ -383,12 +383,11 @@ static uintptr_t mi_segment_commit_mask(mi_segment_t* segment, bool conservative uintptr_t bitcount = *full_size / MI_COMMIT_SIZE; // can be 0 if (bitidx + bitcount > MI_INTPTR_SIZE*8) { - _mi_warning_message("%zu %zu %zu %zu 0x%p %zu\n", bitidx, bitcount, start, end, p, size); + _mi_warning_message("commit mask overflow: %zu %zu %zu %zu 0x%p %zu\n", bitidx, bitcount, start, end, p, size); } mi_assert_internal((bitidx + bitcount) <= (MI_INTPTR_SIZE*8)); uintptr_t mask = (((uintptr_t)1 << bitcount) - 1) << bitidx; - return mask; }