mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-08 00:09:31 +03:00
merge from dev; match test-stress
This commit is contained in:
commit
278f1ff556
3 changed files with 8 additions and 9 deletions
|
@ -272,14 +272,14 @@
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\test\main-override-static.c" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="mimalloc.vcxproj">
|
<ProjectReference Include="mimalloc.vcxproj">
|
||||||
<Project>{abb5eae7-b3e6-432e-b636-333449892ea6}</Project>
|
<Project>{abb5eae7-b3e6-432e-b636-333449892ea6}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="..\..\test\main-override-static.c" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
|
|
@ -682,7 +682,8 @@ static mi_decl_noinline mi_page_t* mi_page_queue_find_free_ex(mi_heap_t* heap, m
|
||||||
_mi_page_free(page_candidate, pq);
|
_mi_page_free(page_candidate, pq);
|
||||||
page_candidate = page;
|
page_candidate = page;
|
||||||
}
|
}
|
||||||
else if (page->used >= page_candidate->used && !mi_page_is_mostly_used(page)) {
|
// prefer to reuse fuller pages (in the hope the less used page gets freed)
|
||||||
|
else if (page->used >= page_candidate->used && !mi_page_is_mostly_used(page) && !mi_page_is_expandable(page)) {
|
||||||
page_candidate = page;
|
page_candidate = page;
|
||||||
}
|
}
|
||||||
// if we find a non-expandable candidate, or searched for N pages, return with the best candidate
|
// if we find a non-expandable candidate, or searched for N pages, return with the best candidate
|
||||||
|
|
|
@ -44,12 +44,10 @@ static int ITER = 10;
|
||||||
static int THREADS = 4;
|
static int THREADS = 4;
|
||||||
static int SCALE = 10;
|
static int SCALE = 10;
|
||||||
static int ITER = 20;
|
static int ITER = 20;
|
||||||
#define ALLOW_LARGE false
|
|
||||||
#elif 0
|
#elif 0
|
||||||
static int THREADS = 32;
|
static int THREADS = 32;
|
||||||
static int SCALE = 50;
|
static int SCALE = 50;
|
||||||
static int ITER = 50;
|
static int ITER = 50;
|
||||||
#define ALLOW_LARGE false
|
|
||||||
#elif 0
|
#elif 0
|
||||||
static int THREADS = 64;
|
static int THREADS = 64;
|
||||||
static int SCALE = 400;
|
static int SCALE = 400;
|
||||||
|
@ -57,7 +55,7 @@ static int ITER = 10;
|
||||||
#define ALLOW_LARGE true
|
#define ALLOW_LARGE true
|
||||||
#else
|
#else
|
||||||
static int THREADS = 32; // more repeatable if THREADS <= #processors
|
static int THREADS = 32; // more repeatable if THREADS <= #processors
|
||||||
static int SCALE = 25; // scaling factor
|
static int SCALE = 50; // scaling factor
|
||||||
static int ITER = 50; // N full iterations destructing and re-creating all threads
|
static int ITER = 50; // N full iterations destructing and re-creating all threads
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -66,7 +64,7 @@ static int ITER = 50; // N full iterations destructing and re-creating a
|
||||||
#define STRESS // undefine for leak test
|
#define STRESS // undefine for leak test
|
||||||
|
|
||||||
#ifndef ALLOW_LARGE
|
#ifndef ALLOW_LARGE
|
||||||
#define ALLOW_LARGE true
|
#define ALLOW_LARGE false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool allow_large_objects = ALLOW_LARGE; // allow very large objects? (set to `true` if SCALE>100)
|
static bool allow_large_objects = ALLOW_LARGE; // allow very large objects? (set to `true` if SCALE>100)
|
||||||
|
@ -360,7 +358,7 @@ int main(int argc, char** argv) {
|
||||||
#else
|
#else
|
||||||
mi_stats_print(NULL); // so we see rss/commit/elapsed
|
mi_stats_print(NULL); // so we see rss/commit/elapsed
|
||||||
#endif
|
#endif
|
||||||
//mi_stats_print(NULL);
|
mi_stats_print(NULL);
|
||||||
//bench_end_program();
|
//bench_end_program();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue