1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-26 08:41:47 -07:00

Fix job003454: when an amc pool is in the finish ramp mode, it should stay there until it can transition to collecting. also update the ramp part of design/poolamc.

Copied from Perforce
 Change: 181325
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Nick Barnes 2013-04-04 16:22:39 +01:00
parent 680b6c0c38
commit f9beff6889

View file

@ -1280,11 +1280,25 @@ static void AMCRampEnd(Pool pool, Buffer buf)
PoolGen pgen = &amc->rampGen->pgen;
Ring node, nextNode;
if(amc->rampMode == RampRAMPING) {
/* We were ramping, so clean up. */
amc->rampMode = RampFINISH;
} else {
amc->rampMode = RampOUTSIDE;
switch(amc->rampMode) {
case RampRAMPING:
/* We were ramping, so clean up. */
amc->rampMode = RampFINISH;
break;
case RampBEGIN:
/* short-circuit for short ramps */
amc->rampMode = RampOUTSIDE;
break;
case RampCOLLECTING:
/* we have finished a circuit of the state machine */
amc->rampMode = RampOUTSIDE;
break;
case RampFINISH:
/* stay in FINISH because we need to pass through COLLECTING */
break;
default:
/* can't get here if already OUTSIDE */
NOTREACHED;
}
/* Adjust amc->rampGen->pgen.newSize: Now count all the segments */
@ -2497,9 +2511,15 @@ static Bool AMCCheck(AMC amc)
CHECKD(amcGen, amc->rampGen);
CHECKD(amcGen, amc->afterRampGen);
}
/* nothing to check for rampCount */
CHECKL(amc->rampMode >= RampOUTSIDE);
CHECKL(amc->rampMode <= RampCOLLECTING);
/* if OUTSIDE, count must be zero. */
CHECKL((amc->rampCount == 0) || (amc->rampMode != RampOUTSIDE));
/* if BEGIN or RAMPING, count must not be zero. */
CHECKL((amc->rampCount != 0) || ((amc->rampMode != RampBEGIN) &&
(amc->rampMode != RampRAMPING)));
/* pageretstruct[ti] is statistics only, currently unchecked */
return TRUE;