mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
update test-stress with better object distribution
This commit is contained in:
parent
194008b869
commit
d2279b2a3f
1 changed files with 7 additions and 3 deletions
|
@ -17,8 +17,8 @@ terms of the MIT license.
|
|||
#include <mimalloc.h>
|
||||
|
||||
// argument defaults
|
||||
static int THREADS = 32; // more repeatable if THREADS <= #processors
|
||||
static int N = 40; // scaling factor
|
||||
static int THREADS = 8; // more repeatable if THREADS <= #processors
|
||||
static int N = 200; // scaling factor
|
||||
|
||||
// static int THREADS = 8; // more repeatable if THREADS <= #processors
|
||||
// static int N = 100; // scaling factor
|
||||
|
@ -63,7 +63,11 @@ static bool chance(size_t perc, random_t r) {
|
|||
}
|
||||
|
||||
static void* alloc_items(size_t items, random_t r) {
|
||||
if (chance(1, r)) items *= 100; // 1% huge objects;
|
||||
if (chance(1, r)) {
|
||||
if (chance(1, r)) items *= 1000; // 0.01% giant
|
||||
else if (chance(10, r)) items *= 100; // 0.1% huge
|
||||
else items *= 10; // 1% large objects;
|
||||
}
|
||||
if (items==40) items++; // pthreads uses that size for stack increases
|
||||
uintptr_t* p = (uintptr_t*)mi_malloc(items*sizeof(uintptr_t));
|
||||
if (p != NULL) {
|
||||
|
|
Loading…
Add table
Reference in a new issue