1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 03:20:39 -08:00

Mps br/unfixed-summary: comment-out the "what caused et?" segdescribes.

Save sketches (abzSketchTotal and abzSketchTotalPrev) in amcseg, 
which get Described when unfixedSummary is wrong: let's see whether 
there's a pattern to the way the previous summary was created.

Copied from Perforce
 Change: 161994
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Kistruck 2007-03-23 15:30:08 +00:00
parent bf36833d79
commit 5e4636ec8b
2 changed files with 47 additions and 6 deletions

View file

@ -86,10 +86,14 @@ typedef struct amcSegStruct *amcSeg;
#define amcSegSig ((Sig)0x519A3C59) /* SIGnature AMC SeG */
#define CB_SKETCH 5
typedef struct amcSegStruct {
GCSegStruct gcSegStruct; /* superclass fields must come first */
int *segTypeP; /* .segtype */
Bool new; /* allocated since last GC */
char abzSketchTotalPrev[CB_SKETCH];
char abzSketchTotal[CB_SKETCH];
Sig sig; /* <code/misc.h#sig> */
} amcSegStruct;
@ -137,6 +141,8 @@ static Res AMCSegInit(Seg seg, Pool pool, Addr base, Size size,
amcseg->segTypeP = segtype; /* .segtype */
amcseg->new = TRUE;
amcseg->abzSketchTotalPrev[0] = '\0';
amcseg->abzSketchTotal[0] = '\0';
amcseg->sig = amcSegSig;
AVERT(amcSeg, amcseg);
@ -221,7 +227,7 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream)
Addr i, p, base, limit, init;
Align step;
Size row;
char abzSketch[5];
char abzSketch[CB_SKETCH];
if (!CHECKT(Seg, seg)) return ResFAIL;
if (stream == NULL) return ResFAIL;
@ -298,6 +304,12 @@ static Res AMCSegDescribe(Seg seg, mps_lib_FILE *stream)
res = WriteF(stream, " Sketch: $S\n", (WriteFS)abzSketch, NULL);
if (res != ResOK) return res;
res = WriteF(stream, " Sketch at previous Total scan: $S\n", (WriteFS)amcseg->abzSketchTotalPrev, NULL);
if (res != ResOK) return res;
res = WriteF(stream, " Sketch at last Total scan: $S\n", (WriteFS)amcseg->abzSketchTotal, NULL);
if (res != ResOK) return res;
res = WriteF(stream, "} AMC Seg $P\n", (WriteFP)seg, NULL);
if (res != ResOK) return res;
@ -1333,7 +1345,27 @@ static Res amcScanNailed(Bool *totalReturn, ScanState ss, Pool pool,
*
* See <design/poolamc/#seg-scan>.
*/
static Res AMCScanInner(Bool *totalReturn, ScanState ss, Pool pool, Seg seg);
static Res AMCScan(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
{
Res res;
amcSeg amcseg;
res = AMCScanInner(totalReturn, ss, pool, seg);
amcseg = Seg2amcSeg(seg);
if ( (res == ResOK) && totalReturn ) {
int i;
for (i = 0; i < NELEMS(amcseg->abzSketchTotalPrev); i += 1) {
amcseg->abzSketchTotalPrev[i] = amcseg->abzSketchTotal[i];
}
AMCSegSketch(seg, amcseg->abzSketchTotal, NELEMS(amcseg->abzSketchTotal));
}
return res;
}
static Res AMCScanInner(Bool *totalReturn, ScanState ss, Pool pool, Seg seg)
{
Addr base, limit;
Arena arena;
@ -1577,6 +1609,7 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
do {
res = BUFFER_RESERVE(&newRef, buffer, length, FALSE);
if (res != ResOK) {
/*
WriteF(mps_lib_get_stdout(),
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
"AMCFix forwarding buffer: BUFFER_RESERVE failed,\n"
@ -1584,6 +1617,7 @@ Res AMCFix(Pool pool, ScanState ss, Seg seg, Ref *refIO)
NULL
);
SegDescribe(seg, mps_lib_get_stdout());
*/
goto returnRes;
}

View file

@ -1094,11 +1094,13 @@ static Res traceScanSegRes(TraceSet ts, Rank rank, Arena arena, Seg seg)
ShieldExpose(arena, seg);
res = PoolScan(&wasTotal, &ss, SegPool(seg), seg);
if (res != ResOK) {
WriteF(mps_lib_get_stdout(),
"PoolScan failed on this seg:\n",
NULL
);
SegDescribe(seg, mps_lib_get_stdout());
/*
WriteF(mps_lib_get_stdout(),
"PoolScan failed on this seg:\n",
NULL
);
SegDescribe(seg, mps_lib_get_stdout());
*/
}
/* Cover, regardless of result */
ShieldCover(arena, seg);
@ -1123,6 +1125,11 @@ static Res traceScanSegRes(TraceSet ts, Rank rank, Arena arena, Seg seg)
/* following is true whether or not scan was total */
/* See <design/scan/#summary.subset>. */
if (!RefSetSub(ss.unfixedSummary, SegSummary(seg))) {
printf("RongRongRongRongRongRongRongRongRongRongRong:\n");
printf(" Total? %s:\n",
(res == ResOK) && wasTotal
? "YES"
: "no");
SegDescribe(seg, mps_lib_get_stdout());
{
TraceId ti;