Esempio n. 1
0
static void closureMark(Object *o){
    Closure *c = o->value;
    if (isRealObject(c->thisContext)) {
        mark(&c->thisContext.object);
    }
    mark(&c->capturedVariables);
    
    Something *t = c->capturedVariables->value;
    for (uint8_t i = 0; i < c->capturedVariablesCount; i++) {
        Something *s = t + c->argumentCount + i;
        if (isRealObject(*s)) {
            mark(&s->object);
        }
    }
}
void dictionaryMark(Object *object){
    EmojicodeDictionary *dict = object->value;
    if(dict->slots){
        mark(&dict->slots);
    }
    for (size_t i = 0; i < dict->capacity; i++) {
        if(slots(dict)[i].key){
            mark(&slots(dict)[i].key);
            if(isRealObject(slots(dict)[i].value)){
                mark(&slots(dict)[i].value.object);
            }
        }
    }
}
Esempio n. 3
0
static void capturedMethodMark(Object *o){
    CapturedFunctionCall *c = o->value;
    if (isRealObject(c->callee)) {
        mark(&c->callee.object);
    }
}