Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/microsoft/mimalloc into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
daanx committed Nov 18, 2024
2 parents 41029d9 + c57e9b8 commit 9cae0d3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/test-stress.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ static int ITER = 50; // N full iterations destructing and re-creating a

#define STRESS // undefine for leak test

#ifndef NDEBUG
#define HEAP_WALK // walk the heap objects?
#endif

static bool allow_large_objects = true; // allow very large objects? (set to `true` if SCALE>100)
static size_t use_one_size = 0; // use single object size of `N * sizeof(uintptr_t)`?

Expand All @@ -68,6 +64,9 @@ static bool main_participates = false; // main thread participates as a
#define custom_calloc(n,s) mi_calloc(n,s)
#define custom_realloc(p,s) mi_realloc(p,s)
#define custom_free(p) mi_free(p)
#ifndef NDEBUG
#define HEAP_WALK // walk the heap objects?
#endif
#endif

// transfer pointer between threads
Expand Down Expand Up @@ -222,7 +221,7 @@ static void test_stress(void) {
uintptr_t r = rand();
for (int n = 0; n < ITER; n++) {
run_os_threads(THREADS, &stress);
#ifndef NDEBUG
#if !defined(NDEBUG) && !defined(USE_STD_MALLOC)
// switch between arena and OS allocation for testing
mi_option_set_enabled(mi_option_disallow_arena_alloc, (n%2)==1);
#endif
Expand Down Expand Up @@ -272,7 +271,7 @@ int main(int argc, char** argv) {
#ifdef HEAP_WALK
mi_option_enable(mi_option_visit_abandoned);
#endif
#ifndef NDEBUG
#if !defined(NDEBUG) && !defined(USE_STD_MALLOC)
mi_option_set(mi_option_arena_reserve, 32 * 1024 /* in kib = 32MiB */);
#endif
#ifndef USE_STD_MALLOC
Expand Down

0 comments on commit 9cae0d3

Please sign in to comment.