If (any) option is given, run GC test forever. Otherwise just run it once.

This commit is contained in:
Jesse D. McDonald 2009-11-09 09:42:01 -06:00
parent 0a2f13b523
commit 4136b74e1b
1 changed files with 5 additions and 4 deletions

View File

@ -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,7 +143,8 @@ static void test_garbage_collection(void)
gc_stats.max_ns = 0; gc_stats.max_ns = 0;
count = 0; count = 0;
break; if (!keep_going)
break;
} }
} }