xirestore: predicates need timestamps inorder to find out which clauses are alive.
This commit is contained in:
parent
1be424fe57
commit
198fc03bae
5
C/qlyr.c
5
C/qlyr.c
@ -800,6 +800,9 @@ ReadHash(IOSTREAM *stream)
|
||||
UInt sz = read_uint(stream);
|
||||
UInt nrefs = read_uint(stream);
|
||||
LogUpdClause *ncl = (LogUpdClause *)Yap_AlwaysAllocCodeSpace(sz);
|
||||
if (!ncl) {
|
||||
QLYR_ERROR(OUT_OF_CODE_SPACE);
|
||||
}
|
||||
ncl->Id = FunctorDBRef;
|
||||
ncl->ClRefCount = nrefs;
|
||||
InsertDBRef((DBRef)ocl,(DBRef)ncl);
|
||||
@ -812,7 +815,6 @@ static void
|
||||
read_clauses(IOSTREAM *stream, PredEntry *pp, UInt nclauses, UInt flags) {
|
||||
CACHE_REGS
|
||||
if (pp->PredFlags & LogUpdatePredFlag) {
|
||||
pp->TimeStampOfPred = 0L;
|
||||
/* first, clean up whatever was there */
|
||||
if (pp->cs.p_code.NOfClauses) {
|
||||
LogUpdClause *cl;
|
||||
@ -927,6 +929,7 @@ read_pred(IOSTREAM *stream, Term mod) {
|
||||
ap->src.OwnerFile = AtomAdjust(ap->src.OwnerFile);
|
||||
}
|
||||
}
|
||||
ap->TimeStampOfPred = read_uint(stream);
|
||||
/* multifile predicates cannot reside in module 0 */
|
||||
if (flags & MultiFileFlag && ap->ModuleOfPred == PROLOG_MODULE)
|
||||
ap->ModuleOfPred = TermProlog;
|
||||
|
4
C/qlyw.c
4
C/qlyw.c
@ -634,8 +634,7 @@ save_clauses(IOSTREAM *stream, PredEntry *pp) {
|
||||
LogUpdClause *cl = ClauseCodeToLogUpdClause(FirstC);
|
||||
|
||||
while (cl != NULL) {
|
||||
if (pp->TimeStampOfPred >= cl->ClTimeStart &&
|
||||
pp->TimeStampOfPred <= cl->ClTimeEnd) {
|
||||
if (IN_BETWEEN(cl->ClTimeStart, pp->TimeStampOfPred, cl->ClTimeEnd)) {
|
||||
UInt size = cl->ClSize;
|
||||
CHECK(save_tag(stream, QLY_START_LU_CLAUSE));
|
||||
CHECK(save_uint(stream, (UInt)cl));
|
||||
@ -690,6 +689,7 @@ save_pred(IOSTREAM *stream, PredEntry *ap) {
|
||||
CHECK(save_uint(stream, ap->PredFlags));
|
||||
CHECK(save_uint(stream, ap->cs.p_code.NOfClauses));
|
||||
CHECK(save_uint(stream, ap->src.IndxId));
|
||||
CHECK(save_uint(stream, ap->TimeStampOfPred));
|
||||
return save_clauses(stream, ap);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user