diff --git a/C/agc.c b/C/agc.c index ca9e3c3e7..a1c636ddb 100644 --- a/C/agc.c +++ b/C/agc.c @@ -188,13 +188,7 @@ mark_hash_entry(AtomHashEntry *HashPtr) if (atm) { AtomEntry *at = RepAtom(atm); do { -#ifdef DEBUG_RESTORE1 /* useful during debug */ - if (IsWideAtom(atm)) - fprintf(errout, "Restoring %S\n", at->WStrOfAE); - else - fprintf(errout, "Restoring %s\n", at->StrOfAE); -#endif - RestoreEntries(RepProp(at->PropsOfAE), FALSE); + RestoreAtom(at); atm = at->NextOfAE; at = RepAtom(CleanAtomMarkedBit(atm)); } while (!EndOfPAEntr(at)); @@ -240,6 +234,8 @@ mark_atoms(void) HashPtr++; } mark_hash_entry(&INVISIBLECHAIN); + RestoreAtom(RepAtom(AtomFoundVar)); + RestoreAtom(RepAtom(AtomFreeTerm)); mark_hash_preds(); } diff --git a/C/save.c b/C/save.c index 938b3572b..5ef84dd38 100644 --- a/C/save.c +++ b/C/save.c @@ -1271,16 +1271,9 @@ RestoreAtomList(Atom atm) if (EndOfPAEntr(at)) return; do { -#ifdef DEBUG_RESTORE2 /* useful during debug */ - fprintf(errout, "Restoring %s\n", at->StrOfAE); -#endif - at->PropsOfAE = PropAdjust(at->PropsOfAE); - RestoreEntries(RepProp(at->PropsOfAE), FALSE); - atm = at->NextOfAE; - at->NextOfAE = atm = AtomAdjust(atm); - at = RepAtom(atm); - } - while (!EndOfPAEntr(at)); + RestoreAtom(at); + at = RepAtom(at->NextOfAE); + } while (!EndOfPAEntr(at)); } @@ -1354,6 +1347,8 @@ restore_heap(void) } INVISIBLECHAIN.Entry = AtomAdjust(INVISIBLECHAIN.Entry); RestoreAtomList(INVISIBLECHAIN.Entry); + RestoreAtom(RepAtom(AtomFoundVar)); + RestoreAtom(RepAtom(AtomFreeTerm)); RestoreHashPreds(); RestoreForeignCodeStructure(); RestoreIOStructures(); diff --git a/H/rheap.h b/H/rheap.h index ad4d6a8aa..399b38ed9 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -11,8 +11,11 @@ * File: rheap.h * * 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 $ +* Revision 1.97 2008/05/12 14:04:23 vsc +* updates to restore +* * Revision 1.96 2008/04/11 16:58:17 ricroc * yapor: seq_def initialization * @@ -259,9 +262,9 @@ static Term AdjustDBTerm(Term trm, Term *p_base) { if (IsVarTerm(trm)) - return AtomTermAdjust(trm); - if (IsAtomTerm(trm)) return CodeVarAdjust(trm); + if (IsAtomTerm(trm)) + return AtomTermAdjust(trm); if (IsPairTerm(trm)) { Term *p; 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)); +}