void MemoryState::downsample(const MemoryState &state) { const int shift = myIgnoreBits - state.myIgnoreBits; const uint64 scale = 1 << shift; // Copy time first for the display to work correctly myTime = state.myTime; myTotalEvents = state.myTotalEvents; for (DisplayIterator it(const_cast<MemoryState &>(state)); !it.atEnd(); it.advance()) { DisplayPage page(it.page()); uint64 myaddr = page.addr() >> shift; myTopExists[myaddr >> theBottomBits] = true; myExists[myaddr >> theDisplayBits] = true; for (uint64 i = 0; i < page.size(); i += scale) { uint &mystate = myState[myaddr].uval; State *arr = page.stateArray(); uint64 n = SYSmin(i+scale, page.size()); for (uint64 j = i; j < n; j++) { mystate = SYSmax(mystate, arr[j].uval); } myaddr++; } } }
void GusdErrorTransport::StealErrors(UT_ErrorManager& victim, UT_ErrorSeverity sev, bool borrowOnly) { if(_mgr) { auto victimSev = victim.getSeverity(); if(victimSev > SYSmax(sev, UT_ERROR_NONE)) { UT_Lock::Scope lock(_lock); _mgr->stealErrors(victim, /*range start*/ 0, /*range end*/ -1, sev, borrowOnly); } } }