fix memory leak

fix overflow handling
VS: ----------------------------------------------------------------------


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1702 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2006-10-11 14:53:57 +00:00
parent a6365ffdea
commit d3dab0f5a1
7 changed files with 185 additions and 10 deletions

View File

@@ -10,8 +10,12 @@
* *
* File: absmi.c *
* comments: Portable abstract machine interpreter *
* Last rev: $Date: 2006-10-10 20:21:42 $,$Author: vsc $ *
* Last rev: $Date: 2006-10-11 14:53:57 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.207 2006/10/10 20:21:42 vsc
* fix new indexing code to actually recover space
* fix predicate info to work for LUs
*
* Revision 1.206 2006/10/10 14:08:15 vsc
* small fixes on threaded implementation.
*
@@ -2070,13 +2074,16 @@ Yap_absmi(int inp)
LOCK(cl->ClLock);
DEC_CLREF_COUNT(cl);
cl->ClFlags &= ~InUseMask;
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
erase = (cl->ClFlags & (ErasedMask|DirtyMask)) && !(cl->ClRefCount);
UNLOCK(cl->ClLock);
if (erase) {
/* at this point, we are the only ones accessing the clause,
hence we don't need to have a lock it */
saveregs();
Yap_ErLogUpdIndex(cl);
if (cl->ClFlags & ErasedMask)
Yap_ErLogUpdIndex(cl);
else
Yap_CleanUpIndex(cl);
setregs();
}
} else {