mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
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:
parent
06dcb18ba2
commit
3f75e8d231
1 changed files with 9 additions and 0 deletions
9
gc.c
9
gc.c
|
@ -1696,6 +1696,15 @@ void gc_wait_handshake()
|
||||||
//for (i = 0; i < m->gc_num_args; i++) {
|
//for (i = 0; i < m->gc_num_args; i++) {
|
||||||
// gc_mark_gray(m, m->gc_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
|
// Also, mark everything the collector moved to the heap
|
||||||
for (i = 0; i < buf_len; i++) {
|
for (i = 0; i < buf_len; i++) {
|
||||||
gc_mark_gray(m, m->moveBuf[i]);
|
gc_mark_gray(m, m->moveBuf[i]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue