mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-04 19:56:34 +02:00
Added comments
This commit is contained in:
parent
fee0675fa2
commit
fc83ee260b
1 changed files with 5 additions and 2 deletions
7
gc.c
7
gc.c
|
@ -545,8 +545,6 @@ void gc_mark_black(object obj)
|
||||||
// Gray any child objects
|
// Gray any child objects
|
||||||
// Note we probably should use some form of atomics/synchronization
|
// Note we probably should use some form of atomics/synchronization
|
||||||
// for cons and vector types, as these pointers could change.
|
// for cons and vector types, as these pointers could change.
|
||||||
// Also this is a case for adding the stack/heap bit, because these could
|
|
||||||
// be stack objects if a thread issued an update.
|
|
||||||
switch(type_of(obj)) {
|
switch(type_of(obj)) {
|
||||||
case cons_tag: {
|
case cons_tag: {
|
||||||
gc_collector_mark_gray(car(obj));
|
gc_collector_mark_gray(car(obj));
|
||||||
|
@ -592,6 +590,11 @@ void gc_mark_black(object obj)
|
||||||
|
|
||||||
void gc_collector_mark_gray(object obj)
|
void gc_collector_mark_gray(object obj)
|
||||||
{
|
{
|
||||||
|
// "Color" objects gray by adding them to the mark stack for further processing.
|
||||||
|
//
|
||||||
|
// Note that stack objects are always colored red during creation, so
|
||||||
|
// they should never be added to the mark stack. Which would be bad because it
|
||||||
|
// could lead to stack corruption.
|
||||||
if (is_object_type(obj) && mark(obj) == gc_color_clear) {
|
if (is_object_type(obj) && mark(obj) == gc_color_clear) {
|
||||||
mark_stack = vpbuffer_add(mark_stack, &mark_stack_len, mark_stack_i++, obj);
|
mark_stack = vpbuffer_add(mark_stack, &mark_stack_len, mark_stack_i++, obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue