fix a few nasties just introduced.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@999 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2004-02-20 15:00:51 +00:00
parent 53c1eb54a2
commit 0c1ed177f6
4 changed files with 21 additions and 10 deletions

View File

@ -432,14 +432,14 @@ kill_first_log_iblock(LogUpdIndex *c, LogUpdIndex *parent, PredEntry *ap)
LOCK(c->ClLock);
ncl = c->ChildIndex;
}
c->ClRefCount--;
UNLOCK(c->ClLock);
/* check if we are still the main index */
if (parent == NULL &&
ap->cs.p_code.TrueCodeOfPred == c->ClCode) {
RemoveMainIndex(ap);
}
/* decrease refs */
decrease_log_indices(c, (yamop *)&(ap->cs.p_code.ExpandCode));
LOCK(c->ClLock);
c->ClRefCount--;
#ifdef DEBUG
{
LogUpdIndex *parent = DBErasedIList, *c0 = NULL;
@ -456,6 +456,8 @@ kill_first_log_iblock(LogUpdIndex *c, LogUpdIndex *parent, PredEntry *ap)
if (!((c->ClFlags & InUseMask) || c->ClRefCount)) {
if (parent != NULL) {
/* sat bye bye */
/* decrease refs */
decrease_log_indices(c, (yamop *)&(ap->cs.p_code.ExpandCode));
LOCK(parent->ClLock);
parent->ClRefCount--;
if (parent->ClFlags & ErasedMask &&

View File

@ -3854,7 +3854,6 @@ EraseLogUpdCl(LogUpdClause *clau)
ap = clau->ClPred;
/* no need to erase what has been erased */
if (!(clau->ClFlags & ErasedMask)) {
/* get ourselves out of the list */
if (clau->ClNext != NULL) {
LOCK(clau->ClNext->ClLock);
@ -3881,9 +3880,9 @@ EraseLogUpdCl(LogUpdClause *clau)
ap->cs.p_code.LastClause = clau->ClPrev->ClCode;
}
}
clau->ClFlags |= ErasedMask;
ap->cs.p_code.NOfClauses--;
WRITE_UNLOCK(ap->PRWLock);
clau->ClFlags |= ErasedMask;
#ifdef DEBUG
{
LogUpdClause *er_head = DBErasedList;

View File

@ -4274,6 +4274,9 @@ Yap_ExpandIndex(PredEntry *ap) {
static path_stack_entry *
push_path(path_stack_entry *sp, yamop **pipc, ClauseDef *clp)
{
if (Yap_Option['i' - 'a' + 1]) {
printf("+ %p=>%p\n",sp,sp+1);
}
sp->flag = pc_entry;
sp->u.pce.pi_pc = pipc;
sp->u.pce.code = clp->Code;
@ -4352,6 +4355,9 @@ pop_path(path_stack_entry **spp, ClauseDef *clp, PredEntry *ap)
path_stack_entry *sp = *spp;
yamop *nipc;
if (Yap_Option['i' - 'a' + 1]) {
printf("- %p-->",sp+1);
}
while ((--sp)->flag != pc_entry);
*spp = sp;
clp->Code = sp->u.pce.code;
@ -4360,10 +4366,16 @@ pop_path(path_stack_entry **spp, ClauseDef *clp, PredEntry *ap)
clp->Tag = sp->u.pce.tag;
if (sp->u.pce.pi_pc == NULL) {
*spp = sp;
if (Yap_Option['i' - 'a' + 1]) {
printf("%p\n", sp);
}
return NULL;
}
nipc = *(sp->u.pce.pi_pc);
*spp = cross_block(sp, sp->u.pce.pi_pc, ap);
if (Yap_Option['i' - 'a' + 1]) {
printf("%p\n",*spp);
}
return nipc;
}

View File

@ -116,11 +116,9 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
LOCK(heap_regs->low_level_trace_lock);
vsc_count++;
if (vsc_count == 213471) vsc_xstop = 1;
if (vsc_count < 1200000) {
UNLOCK(heap_regs->low_level_trace_lock);
return;
}
if (vsc_count == 52404) vsc_xstop = 1;
UNLOCK(heap_regs->low_level_trace_lock);
return;
#ifdef COMMENTED
// if (vsc_count == 218280)
// vsc_xstop = 1;