static bool discard_clean_frame(const FrObject *obj, va_list args) { FrVarArg(uint32_t,thres) ; FrVarArg(int *,discarded) ; FrFrame *frame = ((FrSymbol*)obj)->symbolFrame() ; // throw out the current frame if it is a clean virtual frame last used // before the threshold value of the clock if (frame && frame->isVFrame() && !frame->isLocked() && !frame->dirtyFrame() && frame->getLRUclock() < thres) { frame->discard() ; // discard the frame (*discarded)++ ; } return true ; }
static bool discard_dirty_frame(const FrObject *obj, va_list args) { FrVarArg(uint32_t,thres) ; FrVarArg(int *,discarded) ; FrFrame *frame = ((FrSymbol*)obj)->symbolFrame() ; // throw out any and all unlocked virtual frames, even if dirty, that were // last used before the threshold value of the clock if (frame && frame->isVFrame() && !frame->isLocked() && frame->getLRUclock() < thres) { if (frame->dirtyFrame()) frame->frameName()->commitFrame() ; frame->discard() ; // discard the frame (*discarded)++ ; } return true ; }