fix previous fixes

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2235 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2008-05-12 22:31:37 +00:00
parent f4173813ff
commit 897224b36e
3 changed files with 32 additions and 20 deletions

10
C/agc.c
View File

@ -188,13 +188,7 @@ mark_hash_entry(AtomHashEntry *HashPtr)
if (atm) { if (atm) {
AtomEntry *at = RepAtom(atm); AtomEntry *at = RepAtom(atm);
do { do {
#ifdef DEBUG_RESTORE1 /* useful during debug */ RestoreAtom(at);
if (IsWideAtom(atm))
fprintf(errout, "Restoring %S\n", at->WStrOfAE);
else
fprintf(errout, "Restoring %s\n", at->StrOfAE);
#endif
RestoreEntries(RepProp(at->PropsOfAE), FALSE);
atm = at->NextOfAE; atm = at->NextOfAE;
at = RepAtom(CleanAtomMarkedBit(atm)); at = RepAtom(CleanAtomMarkedBit(atm));
} while (!EndOfPAEntr(at)); } while (!EndOfPAEntr(at));
@ -240,6 +234,8 @@ mark_atoms(void)
HashPtr++; HashPtr++;
} }
mark_hash_entry(&INVISIBLECHAIN); mark_hash_entry(&INVISIBLECHAIN);
RestoreAtom(RepAtom(AtomFoundVar));
RestoreAtom(RepAtom(AtomFreeTerm));
mark_hash_preds(); mark_hash_preds();
} }

View File

@ -1271,16 +1271,9 @@ RestoreAtomList(Atom atm)
if (EndOfPAEntr(at)) if (EndOfPAEntr(at))
return; return;
do { do {
#ifdef DEBUG_RESTORE2 /* useful during debug */ RestoreAtom(at);
fprintf(errout, "Restoring %s\n", at->StrOfAE); at = RepAtom(at->NextOfAE);
#endif } while (!EndOfPAEntr(at));
at->PropsOfAE = PropAdjust(at->PropsOfAE);
RestoreEntries(RepProp(at->PropsOfAE), FALSE);
atm = at->NextOfAE;
at->NextOfAE = atm = AtomAdjust(atm);
at = RepAtom(atm);
}
while (!EndOfPAEntr(at));
} }
@ -1354,6 +1347,8 @@ restore_heap(void)
} }
INVISIBLECHAIN.Entry = AtomAdjust(INVISIBLECHAIN.Entry); INVISIBLECHAIN.Entry = AtomAdjust(INVISIBLECHAIN.Entry);
RestoreAtomList(INVISIBLECHAIN.Entry); RestoreAtomList(INVISIBLECHAIN.Entry);
RestoreAtom(RepAtom(AtomFoundVar));
RestoreAtom(RepAtom(AtomFreeTerm));
RestoreHashPreds(); RestoreHashPreds();
RestoreForeignCodeStructure(); RestoreForeignCodeStructure();
RestoreIOStructures(); RestoreIOStructures();

View File

@ -11,8 +11,11 @@
* File: rheap.h * * File: rheap.h *
* comments: walk through heap code * * comments: walk through heap code *
* * * *
* Last rev: $Date: 2008-05-12 14:04:23 $,$Author: vsc $ * * Last rev: $Date: 2008-05-12 22:31:37 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $ * $Log: not supported by cvs2svn $
* Revision 1.97 2008/05/12 14:04:23 vsc
* updates to restore
*
* Revision 1.96 2008/04/11 16:58:17 ricroc * Revision 1.96 2008/04/11 16:58:17 ricroc
* yapor: seq_def initialization * yapor: seq_def initialization
* *
@ -259,9 +262,9 @@ static Term
AdjustDBTerm(Term trm, Term *p_base) AdjustDBTerm(Term trm, Term *p_base)
{ {
if (IsVarTerm(trm)) if (IsVarTerm(trm))
return AtomTermAdjust(trm);
if (IsAtomTerm(trm))
return CodeVarAdjust(trm); return CodeVarAdjust(trm);
if (IsAtomTerm(trm))
return AtomTermAdjust(trm);
if (IsPairTerm(trm)) { if (IsPairTerm(trm)) {
Term *p; Term *p;
Term out; Term out;
@ -1467,3 +1470,21 @@ RestoreEntries(PropEntry *pp, int int_key)
} }
} }
static void
RestoreAtom(AtomEntry *at)
{
AtomEntry *nat;
#ifdef DEBUG_RESTORE2 /* useful during debug */
if (IsWideAtom(AbsAtom(at)))
fprintf(errout, "Restoring %S\n", at->WStrOfAE);
else
fprintf(errout, "Restoring %s\n", at->StrOfAE);
#endif
at->PropsOfAE = PropAdjust(at->PropsOfAE);
RestoreEntries(RepProp(at->PropsOfAE), FALSE);
/* cannot use AtomAdjust without breaking agc */
nat = RepAtom(at->NextOfAE);
if (nat)
at->NextOfAE = AbsAtom(AtomEntryAdjust(nat));
}