Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3
This commit is contained in:
55
C/adtdefs.c
55
C/adtdefs.c
@@ -69,9 +69,9 @@ InlinedUnlockedMkFunctor(AtomEntry *ae, unsigned int arity)
|
||||
p->NameOfFE = AbsAtom(ae);
|
||||
p->ArityOfFE = arity;
|
||||
p->PropsOfFE = NIL;
|
||||
p->NextOfPE = ae->PropsOfAE;
|
||||
INIT_RWLOCK(p->FRWLock);
|
||||
ae->PropsOfAE = AbsProp((PropEntry *) p);
|
||||
/* respect the first property, in case this is a wide atom */
|
||||
AddPropToAtom(ae, (PropEntry *)p);
|
||||
return ((Functor) p);
|
||||
}
|
||||
|
||||
@@ -104,8 +104,7 @@ Yap_MkFunctorWithAddress(Atom ap, unsigned int arity, FunctorEntry *p)
|
||||
p->KindOfPE = FunctorProperty;
|
||||
p->NameOfFE = ap;
|
||||
p->ArityOfFE = arity;
|
||||
p->NextOfPE = RepAtom(ap)->PropsOfAE;
|
||||
ae->PropsOfAE = AbsProp((PropEntry *) p);
|
||||
AddPropToAtom(ae, (PropEntry *)p);
|
||||
WRITE_UNLOCK(ae->ARWLock);
|
||||
}
|
||||
|
||||
@@ -493,6 +492,7 @@ Yap_GetOpProp(Atom a, op_type type USES_REGS)
|
||||
{ /* look property list of atom a for kind */
|
||||
AtomEntry *ae = RepAtom(a);
|
||||
PropEntry *pp;
|
||||
OpEntry *oinfo = NULL;
|
||||
|
||||
READ_LOCK(ae->ARWLock);
|
||||
pp = RepProp(ae->PropsOfAE);
|
||||
@@ -524,9 +524,21 @@ Yap_GetOpProp(Atom a, op_type type USES_REGS)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
READ_LOCK(info->OpRWLock);
|
||||
/* if it is not the latest module */
|
||||
if (info->OpModule == PROLOG_MODULE) {
|
||||
/* cannot commit now */
|
||||
oinfo = info;
|
||||
pp = RepProp(pp->NextOfPE);
|
||||
} else {
|
||||
READ_LOCK(info->OpRWLock);
|
||||
READ_UNLOCK(ae->ARWLock);
|
||||
return info;
|
||||
}
|
||||
}
|
||||
if (oinfo) {
|
||||
READ_LOCK(oinfo->OpRWLock);
|
||||
READ_UNLOCK(ae->ARWLock);
|
||||
return info;
|
||||
return oinfo;
|
||||
}
|
||||
READ_UNLOCK(ae->ARWLock);
|
||||
return NULL;
|
||||
@@ -898,7 +910,6 @@ Yap_NewPredPropByAtom(AtomEntry *ae, Term cur_mod)
|
||||
p->beamTable = NULL;
|
||||
#endif
|
||||
/* careful that they don't cross MkFunctor */
|
||||
p->NextOfPE = ae->PropsOfAE;
|
||||
if (PRED_GOAL_EXPANSION_FUNC) {
|
||||
Prop p1 = ae->PropsOfAE;
|
||||
|
||||
@@ -914,7 +925,8 @@ Yap_NewPredPropByAtom(AtomEntry *ae, Term cur_mod)
|
||||
p1 = pe->NextOfPE;
|
||||
}
|
||||
}
|
||||
ae->PropsOfAE = p0 = AbsPredProp(p);
|
||||
AddPropToAtom(ae, (PropEntry *)p);
|
||||
p0 = AbsPredProp(p);
|
||||
p->FunctorOfPred = (Functor)AbsAtom(ae);
|
||||
WRITE_UNLOCK(ae->ARWLock);
|
||||
#ifdef LOW_PROF
|
||||
@@ -1033,10 +1045,9 @@ Yap_PutValue(Atom a, Term v)
|
||||
WRITE_UNLOCK(ae->ARWLock);
|
||||
return;
|
||||
}
|
||||
p->NextOfPE = RepAtom(a)->PropsOfAE;
|
||||
RepAtom(a)->PropsOfAE = AbsValProp(p);
|
||||
p->KindOfPE = ValProperty;
|
||||
p->ValueOfVE = TermNil;
|
||||
AddPropToAtom(RepAtom(a), (PropEntry *)p);
|
||||
/* take care that the lock for the property will be inited even
|
||||
if someone else searches for the property */
|
||||
INIT_RWLOCK(p->VRWLock);
|
||||
@@ -1431,30 +1442,6 @@ Yap_RecoverSlots(int n USES_REGS)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Term
|
||||
Yap_GetFromSlot(Int slot USES_REGS)
|
||||
{
|
||||
return(Deref(LCL0[slot]));
|
||||
}
|
||||
|
||||
Term
|
||||
Yap_GetPtrFromSlot(Int slot USES_REGS)
|
||||
{
|
||||
return(LCL0[slot]);
|
||||
}
|
||||
|
||||
Term *
|
||||
Yap_AddressFromSlot(Int slot USES_REGS)
|
||||
{
|
||||
return(LCL0+slot);
|
||||
}
|
||||
|
||||
void
|
||||
Yap_PutInSlot(Int slot, Term t USES_REGS)
|
||||
{
|
||||
LCL0[slot] = t;
|
||||
}
|
||||
|
||||
static HoldEntry *
|
||||
InitAtomHold(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user