If (any) option is given, run GC test forever. Otherwise just run it once.
This commit is contained in:
parent
0a2f13b523
commit
4136b74e1b
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
static void test_builtins(void);
|
static void test_builtins(void);
|
||||||
static void test_weak_boxes_and_wills(void);
|
static void test_weak_boxes_and_wills(void);
|
||||||
static void test_garbage_collection(void);
|
static void test_garbage_collection(bool keep_going);
|
||||||
static void print_value(value_t v);
|
static void print_value(value_t v);
|
||||||
static void print_gc_stats(void);
|
static void print_gc_stats(void);
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
test_builtins();
|
test_builtins();
|
||||||
test_weak_boxes_and_wills();
|
test_weak_boxes_and_wills();
|
||||||
test_garbage_collection();
|
test_garbage_collection(argc > 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -88,7 +88,7 @@ static void test_weak_boxes_and_wills(void)
|
||||||
unregister_gc_root(&tmp_root);
|
unregister_gc_root(&tmp_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_garbage_collection(void)
|
static void test_garbage_collection(bool keep_going)
|
||||||
{
|
{
|
||||||
gc_root_t root;
|
gc_root_t root;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
@ -143,6 +143,7 @@ static void test_garbage_collection(void)
|
||||||
gc_stats.max_ns = 0;
|
gc_stats.max_ns = 0;
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
|
if (!keep_going)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue