statistics info

This commit is contained in:
Vítor Santos Costa
2013-01-23 09:58:02 +00:00
parent 2de1a678e4
commit 3c021a41cf
3 changed files with 45 additions and 8 deletions

View File

@@ -3749,7 +3749,7 @@ index_sz(LogUpdIndex *x)
static Int
lu_statistics(PredEntry *pe USES_REGS)
{
UInt sz = 0, cls = 0, isz = 0;
UInt sz = sizeof(PredEntry), cls = 0, isz = 0;
/* count number of clauses and size */
LogUpdClause *x;
@@ -3765,10 +3765,16 @@ lu_statistics(PredEntry *pe USES_REGS)
x = x->ClNext;
}
}
isz = 0;
if (pe->PredFlags & IndexedPredFlag) {
isz = index_sz(ClauseCodeToLogUpdIndex(pe->cs.p_code.TrueCodeOfPred));
} else {
isz = 0;
/* expand clause blocks */
yamop *ep = ExpandClausesFirst;
while (ep) {
if (ep->u.sssllp.p == pe)
isz += (UInt)NEXTOP((yamop *)NULL,sssllp)+ep->u.sssllp.s1*sizeof(yamop *);
ep = ep->u.sssllp.snext;
}
isz += index_sz(ClauseCodeToLogUpdIndex(pe->cs.p_code.TrueCodeOfPred));
}
return
Yap_unify(ARG2,MkIntegerTerm(cls)) &&