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); LOCK(c->ClLock);
ncl = c->ChildIndex; ncl = c->ChildIndex;
} }
c->ClRefCount--; UNLOCK(c->ClLock);
/* check if we are still the main index */ /* check if we are still the main index */
if (parent == NULL && if (parent == NULL &&
ap->cs.p_code.TrueCodeOfPred == c->ClCode) { ap->cs.p_code.TrueCodeOfPred == c->ClCode) {
RemoveMainIndex(ap); RemoveMainIndex(ap);
} }
/* decrease refs */ LOCK(c->ClLock);
decrease_log_indices(c, (yamop *)&(ap->cs.p_code.ExpandCode)); c->ClRefCount--;
#ifdef DEBUG #ifdef DEBUG
{ {
LogUpdIndex *parent = DBErasedIList, *c0 = NULL; 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 (!((c->ClFlags & InUseMask) || c->ClRefCount)) {
if (parent != NULL) { if (parent != NULL) {
/* sat bye bye */ /* sat bye bye */
/* decrease refs */
decrease_log_indices(c, (yamop *)&(ap->cs.p_code.ExpandCode));
LOCK(parent->ClLock); LOCK(parent->ClLock);
parent->ClRefCount--; parent->ClRefCount--;
if (parent->ClFlags & ErasedMask && if (parent->ClFlags & ErasedMask &&

View File

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

View File

@ -4274,6 +4274,9 @@ Yap_ExpandIndex(PredEntry *ap) {
static path_stack_entry * static path_stack_entry *
push_path(path_stack_entry *sp, yamop **pipc, ClauseDef *clp) 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->flag = pc_entry;
sp->u.pce.pi_pc = pipc; sp->u.pce.pi_pc = pipc;
sp->u.pce.code = clp->Code; 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; path_stack_entry *sp = *spp;
yamop *nipc; yamop *nipc;
if (Yap_Option['i' - 'a' + 1]) {
printf("- %p-->",sp+1);
}
while ((--sp)->flag != pc_entry); while ((--sp)->flag != pc_entry);
*spp = sp; *spp = sp;
clp->Code = sp->u.pce.code; 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; clp->Tag = sp->u.pce.tag;
if (sp->u.pce.pi_pc == NULL) { if (sp->u.pce.pi_pc == NULL) {
*spp = sp; *spp = sp;
if (Yap_Option['i' - 'a' + 1]) {
printf("%p\n", sp);
}
return NULL; return NULL;
} }
nipc = *(sp->u.pce.pi_pc); nipc = *(sp->u.pce.pi_pc);
*spp = cross_block(sp, sp->u.pce.pi_pc, ap); *spp = cross_block(sp, sp->u.pce.pi_pc, ap);
if (Yap_Option['i' - 'a' + 1]) {
printf("%p\n",*spp);
}
return nipc; 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); LOCK(heap_regs->low_level_trace_lock);
vsc_count++; vsc_count++;
if (vsc_count == 213471) vsc_xstop = 1; if (vsc_count == 52404) vsc_xstop = 1;
if (vsc_count < 1200000) { UNLOCK(heap_regs->low_level_trace_lock);
UNLOCK(heap_regs->low_level_trace_lock); return;
return;
}
#ifdef COMMENTED #ifdef COMMENTED
// if (vsc_count == 218280) // if (vsc_count == 218280)
// vsc_xstop = 1; // vsc_xstop = 1;