merge from dev

This commit is contained in:
daanx 2024-06-03 21:01:23 -07:00
commit f79ea2461a
6 changed files with 17 additions and 19 deletions

View file

@ -25,17 +25,14 @@ terms of the MIT license.
// > mimalloc-test-stress [THREADS] [SCALE] [ITER]
//
// argument defaults
#if !defined(MI_TSAN)
static int THREADS = 32; // more repeatable if THREADS <= #processors
static int SCALE = 25; // scaling factor
#if defined(MI_TSAN)
static int ITER = 10; // N full iterations destructing and re-creating all threads (on tsan reduce for azure pipeline limits)
#else
static int ITER = 50; // N full iterations destructing and re-creating all threads
#else // with thread-sanitizer reduce the defaults for azure pipeline limits
static int THREADS = 8;
#endif
// static int THREADS = 8; // more repeatable if THREADS <= #processors
// static int SCALE = 100; // scaling factor
static int SCALE = 25; // scaling factor
static int ITER = 50; // N full iterations destructing and re-creating all threads
#define STRESS // undefine for leak test
@ -133,9 +130,9 @@ static void free_items(void* p) {
custom_free(p);
}
#ifdef HEAP_WALK
#ifdef HEAP_WALK
static bool visit_blocks(const mi_heap_t* heap, const mi_heap_area_t* area, void* block, size_t block_size, void* arg) {
(void)(heap); (void)(area);
(void)(heap); (void)(area);
size_t* total = (size_t*)arg;
if (block != NULL) {
*total += block_size;
@ -260,7 +257,7 @@ static void test_leak(void) {
int main(int argc, char** argv) {
#ifdef HEAP_WALK
mi_option_enable(mi_option_visit_abandoned);
mi_option_enable(mi_option_visit_abandoned);
#endif
#ifndef NDEBUG
mi_option_set(mi_option_arena_reserve, 32 * 1024 /* in kib = 32MiB */);