mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
WIP
This commit is contained in:
parent
45c3d05369
commit
3b932ebfc5
4 changed files with 11 additions and 0 deletions
7
gc.c
7
gc.c
|
@ -1307,6 +1307,12 @@ void gc_mut_cooperate(gc_thread_data * thd, int buf_len)
|
|||
if (thd->scm_thread_obj) {
|
||||
gc_mark_gray(thd, thd->scm_thread_obj);
|
||||
}
|
||||
if (thd->exception_handler_stack) {
|
||||
gc_mark_gray(thd, thd->exception_handler_stack);
|
||||
}
|
||||
if (thd->param_objs) {
|
||||
gc_mark_gray(thd, thd->param_objs);
|
||||
}
|
||||
// Also, mark everything the collector moved to the heap
|
||||
for (i = 0; i < buf_len; i++) {
|
||||
gc_mark_gray(thd, thd->moveBuf[i]);
|
||||
|
@ -1883,6 +1889,7 @@ void gc_thread_data_init(gc_thread_data * thd, int mut_num, char *stack_base,
|
|||
thd->mutation_count = 0;
|
||||
thd->mutations =
|
||||
vpbuffer_realloc(thd->mutations, &(thd->mutation_buflen));
|
||||
thd->param_objs = NULL;
|
||||
thd->exception_handler_stack = NULL;
|
||||
thd->scm_thread_obj = NULL;
|
||||
thd->thread_state = CYC_THREAD_STATE_NEW;
|
||||
|
|
|
@ -294,6 +294,8 @@ struct gc_thread_data_t {
|
|||
char *stack_prev_frame;
|
||||
// Exception handler stack
|
||||
object exception_handler_stack;
|
||||
// Parameter object data
|
||||
object *param_objs;
|
||||
};
|
||||
|
||||
/* GC prototypes */
|
||||
|
|
|
@ -4776,6 +4776,7 @@ int gc_minor(void *data, object low_limit, object high_limit, closure cont,
|
|||
|
||||
// Transport exception stack
|
||||
gc_move2heap(((gc_thread_data *) data)->exception_handler_stack);
|
||||
gc_move2heap(((gc_thread_data *) data)->param_objs);
|
||||
gc_move2heap(((gc_thread_data *) data)->scm_thread_obj);
|
||||
|
||||
// Transport mutations
|
||||
|
|
|
@ -949,6 +949,7 @@
|
|||
((param value) ...)
|
||||
body))))
|
||||
(define (make-parameter init . o)
|
||||
;; TODO: need to store/set value in the thread data parameter (param_objs), to make it thread-specific
|
||||
(let* ((converter
|
||||
(if (pair? o) (car o) (lambda (x) x)))
|
||||
(value (converter init)))
|
||||
|
|
Loading…
Add table
Reference in a new issue