void CodeStart(dyncode* p) { FreeInst(); p->Size = 0; Failed = 0; MoveBack = 0; DelaySlot = 0; }
void cResourceMgr::AllFree(void) { Free(KEY_MGR); Free(SCENE_MGR); Free(TIME_MGR); Free(CAM_MGR); Free(CHAR_MGR); Free(MAP_MGR); Free(MOB_MGR); Free(TEXT_MGR); Free(DATA_MGR); Free(OPTION); Free(SOUND_MGR); D3DFRAME->Free (); //디바이스 FreeInst(); }
void CodeDone(dyncode* p) { FreeInst(); FreeCode(p); }
static PCODEBLOCK SetBlockBreakAndRetrunLevels(PINTERMEDIATE_STATE psState, PCODEBLOCK psStartBlock, IMG_UINT32 uBrkNestingLevel, IMG_UINT32 uRetNestingLevel, CODEBLOCK** ppsEnabledEndAfterEarlyRetBlock) { while(psStartBlock->uNumSuccs > 0) { if (psStartBlock->psBody != NULL) { switch (psStartBlock->psBody->eOpcode) { case ICNDST: { uBrkNestingLevel++; uRetNestingLevel++; psStartBlock = psStartBlock->asSuccs[0].psDest; break; } case ICNDEF: { psStartBlock = psStartBlock->asSuccs[0].psDest; break; } case ICNDEND: { uBrkNestingLevel--; uRetNestingLevel--; psStartBlock = psStartBlock->asSuccs[0].psDest; break; } case ICNDSTLOOP: { uRetNestingLevel += 2; psStartBlock = SetLoopBreakAndRetrunLevels(psState, psStartBlock->asSuccs[0].psDest, uRetNestingLevel, ppsEnabledEndAfterEarlyRetBlock); uRetNestingLevel -= 2; break; } case ICNDLT: { return psStartBlock->asSuccs[1].psDest; } case IBREAK: { PINST psInstToRemove; psInstToRemove = psStartBlock->psBody; RemoveInst(psState, psStartBlock, psStartBlock->psBody); FreeInst(psState, psInstToRemove); AppendExecPredInst(psState, psStartBlock, ICNDSM, USC_PREDREG_NONE, IMG_TRUE, USC_PREDREG_NONE, uBrkNestingLevel + 2); psStartBlock->u.sCond.bDontGenBranch = IMG_TRUE; psStartBlock = psStartBlock->asSuccs[1].psDest; break; } case ICONTINUE: { PINST psInstToRemove; psInstToRemove = psStartBlock->psBody; RemoveInst(psState, psStartBlock, psStartBlock->psBody); FreeInst(psState, psInstToRemove); AppendExecPredInst(psState, psStartBlock, ICNDSM, USC_PREDREG_NONE, IMG_TRUE, USC_PREDREG_NONE, uBrkNestingLevel + 1); psStartBlock = psStartBlock->asSuccs[1].psDest; break; } case IRETURN: { if (((*ppsEnabledEndAfterEarlyRetBlock) == NULL) && (psStartBlock->psOwner->psExit->psBody != NULL)) { PCODEBLOCK psCndExeEndBlock = AllocateBlock(psState, psStartBlock->psOwner); AppendExecPredInst(psState, psCndExeEndBlock, ICNDEND, USC_PREDREG_NONE, IMG_FALSE /* uCondPredInv */, USC_PREDREG_NONE, 1); RedirectEdgesFromPredecessors(psState, psStartBlock->psOwner->psExit, psCndExeEndBlock, IMG_FALSE); SetBlockUnconditional(psState, psCndExeEndBlock, psStartBlock->psOwner->psExit); *ppsEnabledEndAfterEarlyRetBlock = psCndExeEndBlock; } { PINST psInstToRemove; psInstToRemove = psStartBlock->psBody; RemoveInst(psState, psStartBlock, psStartBlock->psBody); FreeInst(psState, psInstToRemove); AppendExecPredInst(psState, psStartBlock, ICNDSM, USC_PREDREG_NONE, IMG_TRUE, USC_PREDREG_NONE, uRetNestingLevel); psStartBlock->u.sCond.bDontGenBranch = IMG_TRUE; if ((*ppsEnabledEndAfterEarlyRetBlock) == NULL) { SetBlockConditionalExecPred(psState, psStartBlock, psStartBlock->psOwner->psExit, psStartBlock->asSuccs[0].psDest, IMG_FALSE); } else { SetBlockConditionalExecPred(psState, psStartBlock, *ppsEnabledEndAfterEarlyRetBlock, psStartBlock->asSuccs[0].psDest, IMG_FALSE); } psStartBlock = psStartBlock->asSuccs[1].psDest; } break; } default: { ASSERT(psStartBlock->uNumSuccs == 1); psStartBlock = psStartBlock->asSuccs[0].psDest; } } } else { ASSERT(psStartBlock->uNumSuccs == 1); psStartBlock = psStartBlock->asSuccs[0].psDest; } } return psStartBlock; }