From 3879759ccc2a70cf49c313e62693b7683e9c3d32 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sat, 13 Oct 2018 18:03:26 -0400 Subject: [PATCH] Demonstrate initiatng GC --- tests/experimental/fac-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/experimental/fac-test.c b/tests/experimental/fac-test.c index 6df1fdf7..87ede6d8 100644 --- a/tests/experimental/fac-test.c +++ b/tests/experimental/fac-test.c @@ -3123,12 +3123,12 @@ static void __host_lambda_1(void *data, int argc, closure self) { object *stack = ((gc_thread_data *)data)->args; // TODO: do it inline for benchmarks/production code top = alloca(sizeof(object)); // TODO: is there a more efficient way? tmp++; - if (tmp == 4) { +// if (tmp%2) { + if ((tmp%2) || stack_overflow(&top, (((gc_thread_data *)data)->stack_limit))) { printf("starting GC\n"); // TODO: -// if (stack_overflow(&top, (((gc_thread_data *)data)->stack_limit))) { - mclosure0(c1, (function_type) __host_lambda_1); - GC(data, &c1, buf, ?); + //mclosure0(c1, (function_type) __host_lambda_1); + GC(data, self, ((gc_thread_data *)data)->args, argc); return; } // TODO: if exceeded stack limit, initiate minor GC