Memory management and UTF-8 for all fixes

This commit is contained in:
Vitor Santos Costa
2016-11-04 11:36:48 -05:00
parent 02e0e50915
commit 46a9d52d2d
26 changed files with 526 additions and 483 deletions

View File

@@ -57,10 +57,15 @@ GetFunctorProp(AtomEntry *ae,
arity_t arity) { /* look property list of atom a for kind */
FunctorEntry *pp;
pp = RepFunctorProp(ae->PropsOfAE);
while (!EndOfPAEntr(pp) && (pp = RepFunctorProp(pp->NextOfPE)))
;
return (AbsFunctorProp(pp));
PropEntry *p = RepFunctorProp(ae->PropsOfAE);
while (p != NIL) {
if (p->KindOfPE == FunctorProperty &&
RepFunctorProp(p)->ArityOfFE == arity) {
return p;
}
p = p->NextOfPE;
}
return NIL;
}
/* vsc: We must guarantee that IsVarTerm(functor) returns true! */
@@ -155,7 +160,6 @@ LookupAtom(const unsigned char *atom) { /* lookup atom in atom table */
hash = HashFunction(p);
hash = hash % sz;
/* we'll start by holding a read lock in order to avoid contention */
READ_LOCK(HashChain[hash].AERWLock);
a = HashChain[hash].Entry;
@@ -199,6 +203,7 @@ LookupAtom(const unsigned char *atom) { /* lookup atom in atom table */
if (NOfAtoms > 2 * AtomHashTableSize) {
Yap_signal(YAP_CDOVF_SIGNAL);
}
return na;
}