diff options
author | daan <daanl@outlook.com> | 2022-02-05 10:57:15 -0800 |
---|---|---|
committer | daan <daanl@outlook.com> | 2022-02-05 10:57:15 -0800 |
commit | e11100a13780297d7016eba0fcf541c85f60c16b (patch) | |
tree | 1818c905e5ee1c85e1fad947baacae7e24878946 /include | |
parent | 9ca363d0e49d55d88efef872acd25f067fbb3aed (diff) |
add minimal commit size for increased efficiency (decommit fine grained, commit coarse grained)
Diffstat (limited to 'include')
-rw-r--r-- | include/mimalloc-types.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/mimalloc-types.h b/include/mimalloc-types.h index 8cd3a4c..6354979 100644 --- a/include/mimalloc-types.h +++ b/include/mimalloc-types.h @@ -320,10 +320,15 @@ typedef enum mi_segment_kind_e { // the corresponding MI_COMMIT_SIZE area is committed. // The MI_COMMIT_SIZE must be a multiple of the slice // size. If it is equal we have the most fine grained -// decommit but setting it higher can be more efficient. +// decommit (but setting it higher can be more efficient). +// The MI_MINIMAL_COMMIT_SIZE is the minimal amount that will +// be committed in one go which can be set higher than +// MI_COMMIT_SIZE for efficiency (while the decommit mask +// is still tracked in fine-grained MI_COMMIT_SIZE chunks) // ------------------------------------------------------ -#define MI_COMMIT_SIZE (8*MI_SEGMENT_SLICE_SIZE) +#define MI_MINIMAL_COMMIT_SIZE (16*MI_SEGMENT_SLICE_SIZE) // 1MiB +#define MI_COMMIT_SIZE (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) |