mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
switch between OS and arena allocation in stress test
This commit is contained in:
parent
7e23576efa
commit
1a9cf7bce2
1 changed files with 4 additions and 0 deletions
|
@ -212,6 +212,10 @@ static void test_stress(void) {
|
||||||
uintptr_t r = rand();
|
uintptr_t r = rand();
|
||||||
for (int n = 0; n < ITER; n++) {
|
for (int n = 0; n < ITER; n++) {
|
||||||
run_os_threads(THREADS, &stress);
|
run_os_threads(THREADS, &stress);
|
||||||
|
#ifndef NDEBUG
|
||||||
|
// switch between arena and OS allocation for testing
|
||||||
|
mi_option_set_enabled(mi_option_disallow_arena_alloc, (n%2)==1);
|
||||||
|
#endif
|
||||||
#ifdef HEAP_WALK
|
#ifdef HEAP_WALK
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
mi_abandoned_visit_blocks(mi_subproc_main(), -1, true, visit_blocks, &total);
|
mi_abandoned_visit_blocks(mi_subproc_main(), -1, true, visit_blocks, &total);
|
||||||
|
|
Loading…
Add table
Reference in a new issue