Definitions to support C host functions

This commit is contained in:
Justin Ethier 2018-10-06 18:14:30 -04:00
parent 80ac3ef86f
commit c09851a3de
2 changed files with 7 additions and 0 deletions

2
gc.c
View file

@ -2669,6 +2669,8 @@ void gc_thread_data_init(gc_thread_data * thd, int mut_num, char *stack_base,
(1 - STACK_GROWTH_IS_DOWNWARD)); (1 - STACK_GROWTH_IS_DOWNWARD));
exit(1); exit(1);
} }
thd->pc = 0;
thd->args = calloc(MAX_C_ARGS, sizeof(object));
thd->stack_traces = calloc(MAX_STACK_TRACES, sizeof(char *)); thd->stack_traces = calloc(MAX_STACK_TRACES, sizeof(char *));
thd->stack_trace_idx = 0; thd->stack_trace_idx = 0;
thd->stack_prev_frame = NULL; thd->stack_prev_frame = NULL;

View file

@ -340,8 +340,13 @@ struct gc_thread_data_t {
object exception_handler_stack; object exception_handler_stack;
// Parameter object data // Parameter object data
object param_objs; object param_objs;
// Support for host functions
int pc;
object *args;
}; };
#define MAX_C_ARGS 128
/* GC prototypes */ /* GC prototypes */
void gc_initialize(void); void gc_initialize(void);
void gc_add_mutator(gc_thread_data * thd); void gc_add_mutator(gc_thread_data * thd);