Mark objects when collector cooperates

When the collector cooperates for a mutator it needs to mark any heap-collected objects that are stored within the mutator's data object. This prevents problems where these objects (which are essentially per-thread global roots) are incorrectly collected.
This commit is contained in:
Justin Ethier 2017-03-16 14:07:36 +00:00
parent 06dcb18ba2
commit 3f75e8d231

9
gc.c
View file

@ -1696,6 +1696,15 @@ void gc_wait_handshake()
//for (i = 0; i < m->gc_num_args; i++) {
// gc_mark_gray(m, m->gc_args[i]);
//}
if (m->scm_thread_obj) {
gc_mark_gray(m, m->scm_thread_obj);
}
if (m->exception_handler_stack) {
gc_mark_gray(m, m->exception_handler_stack);
}
if (m->param_objs) {
gc_mark_gray(m, m->param_objs);
}
// Also, mark everything the collector moved to the heap
for (i = 0; i < buf_len; i++) {
gc_mark_gray(m, m->moveBuf[i]);