Beispiel #1
0
int block_gc_children_mark(sObject* self)
{
    int count = 0;

    int i;
    for(i=0; i<SBLOCK(self).mStatmentsNum; i++) {
        int j;
        for(j=0; j<SBLOCK(self).mStatments[i].mCommandsNum; j++) {
            int k;
            for(k=0; k<SBLOCK(self).mStatments[i].mCommands[j].mBlocksNum; k++) 
            {
                sObject* block = SBLOCK(self).mStatments[i].mCommands[j].mBlocks[k];
                if(IS_MARKED(block) == 0) {
                    SET_MARK(block);
                    count++;
                    count += block_gc_children_mark(block);
                }
            }
            for(k=0; k<SBLOCK(self).mStatments[i].mCommands[j].mEnvsNum; k++) {
                if(SBLOCK(self).mStatments[i].mCommands[j].mEnvs[k].mFlags & ENV_FLAGS_KIND_BLOCK) {
                    sObject* block = SBLOCK(self).mStatments[i].mCommands[j].mEnvs[k].mBlock;
                    if(IS_MARKED(block) == 0) {
                        SET_MARK(block);
                        count++;
                        count += block_gc_children_mark(block);
                    }
                }
            }
        }
    }

    return count;
}
Beispiel #2
0
int alias_gc_children_mark(sObject* self)
{
    int count = 0;

    sObject* block = SALIAS(self).mBlock;
    if(block) {
        if(IS_MARKED(block) == 0) {
            SET_MARK(block);
            count++;
            count += object_gc_children_mark(block);
        }
    }

    sObject* parent = SALIAS(self).mParent;
    if(parent) {
        if(IS_MARKED(parent) == 0) {
            SET_MARK(parent);
            count++;
            count += object_gc_children_mark(parent);
        }
    }

    sObject* lobjects = SALIAS(self).mLocalObjects;
    if(lobjects) {
        if(IS_MARKED(lobjects) == 0) {
            SET_MARK(lobjects);
            count++;
            count += object_gc_children_mark(lobjects);
        }
    }

    sObject* arg_blocks = SALIAS(self).mArgBlocks;
    if(arg_blocks) {
        if(IS_MARKED(arg_blocks) == 0) {
            SET_MARK(arg_blocks);
            count++;
            count += object_gc_children_mark(arg_blocks);
        }
    }

    return count;
}
Beispiel #3
0
int vector_gc_children_mark(sObject* self)
{
    int count = 0;
    int i;
    for(i=0; i<SVECTOR(self).mCount; i++) {
        sObject* item = SVECTOR(self).mTable[i];

        if(item && IS_MARKED(item) == 0) {
            SET_MARK(item);
            count++;

            count += object_gc_children_mark(item);
        }
    }

    return count;
}