/* * DISCARD { ALL | SEQUENCES | TEMP | PLANS } */ void DiscardCommand(DiscardStmt *stmt, bool isTopLevel) { switch (stmt->target) { case DISCARD_ALL: DiscardAll(isTopLevel); break; case DISCARD_PLANS: ResetPlanCache(); break; case DISCARD_SEQUENCES: ResetSequenceCaches(); break; case DISCARD_TEMP: ResetTempTableNamespace(); break; default: elog(ERROR, "unrecognized DISCARD target: %d", stmt->target); } }
uint64_t* CChainWalkSet::RequestWalk( unsigned char* pHash, int nHashLen , std::string sHashRoutineName, std::string sBIN, int nRainbowTableIndex , int nRainbowChainLen, bool& fNewlyGenerated, bool setDebug , std::string sPrecalc ) { debug = setDebug; sPrecalcPathName = sPrecalc; if ( m_sHashRoutineName != sHashRoutineName || m_sBIN != sBIN || m_nRainbowTableIndex != nRainbowTableIndex || m_nRainbowChainLen != nRainbowChainLen) { DiscardAll(); m_sHashRoutineName = sHashRoutineName; m_sBIN = sBIN; m_nRainbowTableIndex = nRainbowTableIndex; m_nRainbowChainLen = nRainbowChainLen; ChainWalk cw; memcpy(cw.Hash, pHash, nHashLen); cw.pIndexE = new uint64_t[nRainbowChainLen - 1]; m_lChainWalk.push_back(cw); // Only update this list when we search through another rainbow table updateUsedPrecalcFiles(); if (!FindInFile(cw.pIndexE, pHash, nHashLen)) fNewlyGenerated = true; else fNewlyGenerated = false; return cw.pIndexE; } std::list<ChainWalk>::iterator it; for (it = m_lChainWalk.begin(); it != m_lChainWalk.end(); it++) { if (memcmp(it->Hash, pHash, nHashLen) == 0) { fNewlyGenerated = false; return it->pIndexE; } } ChainWalk cw; memcpy(cw.Hash, pHash, nHashLen); cw.pIndexE = new uint64_t[nRainbowChainLen - 1]; m_lChainWalk.push_back(cw); if (!FindInFile(cw.pIndexE, pHash, nHashLen)) fNewlyGenerated = true; else fNewlyGenerated = false; return cw.pIndexE; }
/** * Shut down the tracker, deallocating the timer. */ void DiscardTracker::Shutdown() { MOZ_ASSERT(NS_IsMainThread()); if (sTimer) { sTimer->Cancel(); sTimer = NULL; } // Clear the sDiscardableImages linked list so that its destructor // (LinkedList.h) finds an empty array, which is required after bug 803688. DiscardAll(); }
/** * Shut down the tracker, deallocating the timer. */ void DiscardTracker::Shutdown() { sShutdown = true; if (sTimer) { sTimer->Cancel(); sTimer = nullptr; } // Clear the sDiscardableImages linked list so that its destructor // (LinkedList.h) finds an empty array, which is required after bug 803688. DiscardAll(); delete sNodeListMutex; sNodeListMutex = nullptr; }
CChainWalkSet::~CChainWalkSet() { DiscardAll(); }