get rid of ClUse in logupdindices

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@895 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2003-10-14 13:10:26 +00:00
parent ef5b98628f
commit 9d64f1d2d1
5 changed files with 7 additions and 19 deletions

View File

@ -1103,7 +1103,6 @@ Yap_absmi(int inp)
if (!(cl->ClFlags & InUseMask)) {
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
cl->ClUse = TR-(tr_fr_ptr)(Yap_TrailBase);
}
#endif
UNLOCK(cl->ClLock);
@ -1135,11 +1134,10 @@ Yap_absmi(int inp)
UNLOCK(cl->ClLock);
}
#else
if (cl->ClUse == TR-(tr_fr_ptr)(Yap_TrailBase)) {
cl->ClUse = 0;
if (B->cp_tr[-1] == CLREF_TO_TRENTRY(cl) &&
B->cp_tr > B->cp_b->cp_tr) {
cl->ClFlags &= ~InUseMask;
/* clear the entry from the trail */
TR = --(B->cp_tr);
TR = --B->cp_tr;
/* next, recover space for the indexing code if it was erased */
if (cl->ClFlags & ErasedMask) {
Yap_RemoveLogUpdIndex(cl);

View File

@ -12,7 +12,7 @@
* Last rev: *
* mods: *
* comments: allocating space *
* version:$Id: alloc.c,v 1.34 2003-10-14 00:53:10 vsc Exp $ *
* version:$Id: alloc.c,v 1.35 2003-10-14 13:10:26 vsc Exp $ *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
@ -375,10 +375,6 @@ AllocCodeSpace(unsigned int size)
char *
Yap_AllocCodeSpace(unsigned int size)
{
if (size == 768) {
printf("vsc: Here I go\n");
}
return AllocCodeSpace(size);
}

View File

@ -1119,7 +1119,6 @@ init_log_upd_table(LogUpdIndex *ic, union clause_obj *cl_u)
ic->SiblingIndex = cl_u->lui.ChildIndex;
ic->ChildIndex = NULL;
ic->ClRefCount = 0;
ic->ClUse = 0L;
ic->u.ParentIndex = (LogUpdIndex *)cl_u;
cl_u->lui.ChildIndex = ic;
cl_u->lui.ClRefCount++;
@ -2083,7 +2082,6 @@ do_pass(void)
cl_u->lui.ChildIndex = NULL;
cl_u->lui.SiblingIndex = NULL;
cl_u->lui.u.pred = CurrentPred;
cl_u->lui.ClUse = 0;
cl_u->lui.ClRefCount = 0;
}
code_p = cl_u->lui.ClCode;

View File

@ -4307,7 +4307,6 @@ replace_index_block(ClauseUnion *parent_block, yamop *cod, yamop *ncod, PredEntr
*c = parent_block->lui.ChildIndex;
ncl->SiblingIndex = cl->SiblingIndex;
ncl->ClRefCount = cl->ClRefCount;
ncl->ClUse = 0L;
ncl->ChildIndex = cl->ChildIndex;
ncl->u.ParentIndex = cl->u.ParentIndex;
if (c == cl) {
@ -4696,7 +4695,6 @@ replace_lu_block(LogUpdIndex *blk, int flag, PredEntry *ap, yamop *code, int has
return NULL;
ncl->ClFlags = LogUpdMask|IndexedPredFlag|IndexMask;
ncl->ClRefCount = 0;
ncl->ClUse = 0;
ncl->u.ParentIndex = blk->u.ParentIndex;
ncl->ChildIndex = NULL;
codep = start = ncl->ClCode;
@ -6091,8 +6089,8 @@ Yap_follow_lu_indexing_code(PredEntry *ap, yamop *ipc, Term t1, Term tb, Term tr
UNLOCK(cl->ClLock);
}
#else
if (cl->ClUse == TR-(tr_fr_ptr)(Yap_TrailBase)) {
cl->ClUse = 0;
if (B->cp_tr[-1] == CLREF_TO_TRENTRY(cl) &&
B->cp_tr > B->cp_b->cp_tr) {
cl->ClFlags &= ~InUseMask;
/* clear the entry from the trail */
TR = --(B->cp_tr);
@ -6121,8 +6119,7 @@ Yap_follow_lu_indexing_code(PredEntry *ap, yamop *ipc, Term t1, Term tb, Term tr
if (!(cl->ClFlags & InUseMask)) {
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
cl->ClUse = TR-(tr_fr_ptr)(Yap_TrailBase);
}
}
#endif
UNLOCK(cl->ClLock);
}

View File

@ -45,7 +45,6 @@ typedef struct logic_upd_index {
/* A lock for manipulating the clause */
lockvar ClLock;
#endif
UInt ClUse;
union {
PredEntry *pred;
struct logic_upd_index *ParentIndex;