示例#1
0
文件: type.c 项目: gdkar/picoc
/* deallocate heap-allocated types */
void TypeCleanupNode(Picoc *pc, struct ValueType *Typ){
    struct ValueType *SubType;
    struct ValueType *NextSubType;
    /* clean up and free all the sub-nodes */
    for (SubType = Typ->DerivedTypeList; SubType; SubType = NextSubType){
        NextSubType = SubType->Next;
        TypeCleanupNode(pc, SubType);
        if (SubType->OnHeap){
            /* if it's a struct or union deallocate all the member values */
            if (SubType->Members != NULL){
                VariableTableCleanup(pc, SubType->Members);
                HeapFreeMem(pc, SubType->Members);
            }
            /* free this node */
            HeapFreeMem(pc, SubType);
        }
    }
}
示例#2
0
文件: type.c 项目: josegomezr/PicoCi
void TypeCleanup()
{
    TypeCleanupNode(&UberType);
}
示例#3
0
文件: type.c 项目: gdkar/picoc
void TypeCleanup(Picoc *pc){TypeCleanupNode(pc, &pc->UberType);}