From 195249e6bf5eebb7c25118f15ff29fddf8761bfb Mon Sep 17 00:00:00 2001 From: Daan Leijen Date: Tue, 7 Jan 2025 19:28:44 -0800 Subject: [PATCH] maintain precise try count for reclaim --- ide/vs2022/mimalloc-lib.vcxproj | 10 +++++----- ide/vs2022/mimalloc-lib.vcxproj.filters | 6 +++--- ide/vs2022/mimalloc-override-dll.vcxproj | 10 +++++----- ide/vs2022/mimalloc-override-dll.vcxproj.filters | 6 +++--- src/segment.c | 1 + 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ide/vs2022/mimalloc-lib.vcxproj b/ide/vs2022/mimalloc-lib.vcxproj index 6c652b8a..9e5371af 100644 --- a/ide/vs2022/mimalloc-lib.vcxproj +++ b/ide/vs2022/mimalloc-lib.vcxproj @@ -421,15 +421,15 @@ - + + true + true true true - true true - true - true true - true + true + true diff --git a/ide/vs2022/mimalloc-lib.vcxproj.filters b/ide/vs2022/mimalloc-lib.vcxproj.filters index 90703da8..3acf4015 100644 --- a/ide/vs2022/mimalloc-lib.vcxproj.filters +++ b/ide/vs2022/mimalloc-lib.vcxproj.filters @@ -16,9 +16,6 @@ Sources - - Sources - Sources @@ -64,6 +61,9 @@ Sources + + Sources + diff --git a/ide/vs2022/mimalloc-override-dll.vcxproj b/ide/vs2022/mimalloc-override-dll.vcxproj index bc822590..728c4f59 100644 --- a/ide/vs2022/mimalloc-override-dll.vcxproj +++ b/ide/vs2022/mimalloc-override-dll.vcxproj @@ -438,15 +438,15 @@ - + + true + true true true - true true - true - true true - true + true + true diff --git a/ide/vs2022/mimalloc-override-dll.vcxproj.filters b/ide/vs2022/mimalloc-override-dll.vcxproj.filters index c6bde0ac..00d677d3 100644 --- a/ide/vs2022/mimalloc-override-dll.vcxproj.filters +++ b/ide/vs2022/mimalloc-override-dll.vcxproj.filters @@ -16,9 +16,6 @@ Sources - - Sources - Sources @@ -61,6 +58,9 @@ Sources + + Sources + diff --git a/src/segment.c b/src/segment.c index 3f23374b..27a3f295 100644 --- a/src/segment.c +++ b/src/segment.c @@ -1044,6 +1044,7 @@ static mi_segment_t* mi_segment_try_reclaim(mi_heap_t* heap, size_t block_size, else { // otherwise, mark it back as abandoned // todo: reset delayed pages in the segment? + max_tries++; // don't count this as a try since it was not suitable _mi_arena_segment_mark_abandoned(segment); } }