From c09851a3deff973edbfc41c799074528068b1a42 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sat, 6 Oct 2018 18:14:30 -0400 Subject: [PATCH] Definitions to support C host functions --- gc.c | 2 ++ include/cyclone/types.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/gc.c b/gc.c index f1c55afc..b03229a6 100644 --- a/gc.c +++ b/gc.c @@ -2669,6 +2669,8 @@ void gc_thread_data_init(gc_thread_data * thd, int mut_num, char *stack_base, (1 - STACK_GROWTH_IS_DOWNWARD)); exit(1); } + thd->pc = 0; + thd->args = calloc(MAX_C_ARGS, sizeof(object)); thd->stack_traces = calloc(MAX_STACK_TRACES, sizeof(char *)); thd->stack_trace_idx = 0; thd->stack_prev_frame = NULL; diff --git a/include/cyclone/types.h b/include/cyclone/types.h index 06cf71ca..19a5e769 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -340,8 +340,13 @@ struct gc_thread_data_t { object exception_handler_stack; // Parameter object data object param_objs; + // Support for host functions + int pc; + object *args; }; +#define MAX_C_ARGS 128 + /* GC prototypes */ void gc_initialize(void); void gc_add_mutator(gc_thread_data * thd);