From 5f92a9550e8872f7d657e6f7024b580ec732fb7d Mon Sep 17 00:00:00 2001 From: vsc Date: Fri, 14 Feb 2003 10:51:29 +0000 Subject: [PATCH] support new version of database in save/restore. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@773 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- H/rheap.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/H/rheap.h b/H/rheap.h index 7178f475a..efeded36a 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -516,11 +516,29 @@ RestoreDB(DBEntry *pp) pp->FunctorOfDB = FuncAdjust(pp->FunctorOfDB); else pp->FunctorOfDB = (Functor) AtomAdjust((Atom)(pp->FunctorOfDB)); - dbr = pp->First; - /* While we have something in the data base, restore it */ - while (dbr) { - RestoreDBEntry(dbr); - dbr = dbr->Next; + if (pp->KindOfPE & LogUpdDBBit) { + dbr = pp->First; + /* While we have something in the data base, restore it */ + while (dbr) { + RestoreDBEntry(dbr); + dbr = dbr->Next; + } + } else { + if (pp->F0 != NULL) + pp->F0 = DBRefAdjust(pp->F0); + if (pp->L0 != NULL) + pp->L0 = DBRefAdjust(pp->L0); + /* immediate update semantics */ + dbr = pp->F0; + /* While we have something in the data base, even if erased, restore it */ + while (dbr) { + RestoreDBEntry(dbr); + if (dbr->n != NULL) + dbr->n = DBRefAdjust(dbr->n); + if (dbr->p != NULL) + dbr->p = DBRefAdjust(dbr->p); + dbr = dbr->n; + } } }