summaryrefslogtreecommitdiff
path: root/include/mimalloc-types.h
diff options
context:
space:
mode:
authordaan <daanl@outlook.com>2021-11-13 20:12:03 -0800
committerdaan <daanl@outlook.com>2021-11-13 20:12:03 -0800
commit511a8996f3568ba59ca019067173d1242a5dd786 (patch)
tree998d24cd912aebb56818f911f74d43d14cbd2fad /include/mimalloc-types.h
parent7e22e5ce6e624f52d31738373a87560656c33470 (diff)
increase commit mask blocks to 2xslice size
Diffstat (limited to 'include/mimalloc-types.h')
-rw-r--r--include/mimalloc-types.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/mimalloc-types.h b/include/mimalloc-types.h
index cd12418..6b9da83 100644
--- a/include/mimalloc-types.h
+++ b/include/mimalloc-types.h
@@ -308,12 +308,11 @@ typedef enum mi_segment_kind_e {
// A segment holds a commit mask where a bit is set if
// the corresponding MI_COMMIT_SIZE area is committed.
// The MI_COMMIT_SIZE must be a multiple of the slice
-// size. We define it as equal so we can decommit on a
-// slice level which helps with (real) memory fragmentation
-// over time.
+// size. If it is equal we have the most fine grained
+// decommit but in practice 2x seems to perform better.
// ------------------------------------------------------
-#define MI_COMMIT_SIZE (MI_SEGMENT_SLICE_SIZE)
+#define MI_COMMIT_SIZE (2*MI_SEGMENT_SLICE_SIZE)
#define MI_COMMIT_MASK_BITS (MI_SEGMENT_SIZE / MI_COMMIT_SIZE)
#define MI_COMMIT_MASK_FIELD_BITS MI_SIZE_BITS
#define MI_COMMIT_MASK_FIELD_COUNT (MI_COMMIT_MASK_BITS / MI_COMMIT_MASK_FIELD_BITS)