do not always remove the full index if removing a root node.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@894 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2003-10-14 01:32:55 +00:00
parent 521e70e9ab
commit ef5b98628f
2 changed files with 4 additions and 2 deletions

View File

@ -158,7 +158,7 @@ LookupAtom(char *atom)
return(a);
}
/* add new atom to start of chain */
ae = (AtomEntry *) Yap_AllocAtomSpace((sizeof *ae) + strlen(atom));
ae = (AtomEntry *) Yap_AllocAtomSpace((sizeof *ae) + strlen(atom) + 1);
a = AbsAtom(ae);
ae->NextOfAE = HashChain[hash].Entry;
HashChain[hash].Entry = a;

View File

@ -399,7 +399,9 @@ kill_first_log_iblock(LogUpdIndex *c, LogUpdIndex *cl, PredEntry *ap)
ncl = next;
}
c->ClRefCount--;
if (cl == NULL) {
/* check if we are still the main index */
if (cl == NULL &&
ap->cs.p_code.TrueCodeOfPred == c->ClCode) {
RemoveMainIndex(ap);
}
if (!((c->ClFlags & InUseMask) || c->ClRefCount)) {