From 9a032b656a737380434b1cb8602472443678f70a Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 11 Feb 2003 16:33:24 +0000 Subject: [PATCH] fix previous module processing fixes check if predicate is not in use before abolish static git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@763 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/cdmgr.c | 8 +++++++- C/heapgc.c | 10 ++++++---- C/tracer.c | 16 +++++++++------- pl/modules.yap | 6 +++--- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/C/cdmgr.c b/C/cdmgr.c index 477974ffa..4ce0e1003 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -1279,7 +1279,7 @@ p_purge_clauses(void) RemoveIndexation(pred); Yap_PutValue(AtomAbol, MkAtomTerm(AtomTrue)); q = pred->cs.p_code.FirstClause; - in_use = static_in_use(pred,FALSE); + in_use = static_in_use(pred,TRUE); if (q != NIL) do { q1 = q; @@ -1845,6 +1845,12 @@ search_for_static_predicate_in_use(PredEntry *p, int check_everything) choiceptr b_ptr = B; CELL *env_ptr = ENV; + if (check_everything) { + PredEntry *pe = EnvPreg(P); + if (p == pe) return(TRUE); + pe = EnvPreg(CP); + if (p == pe) return(TRUE); + } do { /* check first environments that are younger than our latest choicepoint */ if (check_everything) { diff --git a/C/heapgc.c b/C/heapgc.c index bb122bbcf..59a02c67e 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -3161,19 +3161,21 @@ Yap_gc(Int predarity, CELL *current_env, yamop *nextop) #endif if (Yap_GetValue(AtomGc) != TermNil) gc_on = TRUE; - if (IsIntTerm(Tgc_margin = Yap_GetValue(AtomGcMargin))) + if (IsIntTerm(Tgc_margin = Yap_GetValue(AtomGcMargin))) { gc_margin = IntOfTerm(Tgc_margin); - else { + } else { if (gc_calls < 8) gc_margin <<= gc_calls; else gc_margin <<= 8; } - if (gc_margin < 0 || gc_margin > 4000) + if (gc_margin < 0 || gc_margin > 4000) { gc_margin = (LCL0 - H0) >> 9; + } gc_margin = gc_margin << 8; - if (gc_on) + if (gc_on) { effectiveness = do_gc(predarity, current_env, nextop); + } if (effectiveness > 90) { while (gc_margin < H-H0) gc_margin <<= 1; diff --git a/C/tracer.c b/C/tracer.c index 117454c7f..d403522fc 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -112,14 +112,16 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) vsc_count++; /* return;*/ - /* if (vsc_count < 38372100LL) return;*/ - /* if (vsc_count == 80) { - printf("Here I go\n"); - } */ - /* if (vsc_count > 500000) exit(0); */ - /* if (gc_calls < 1) return; */ +#ifdef COMMENTED + if (vsc_count < 414040LL) return; + if (vsc_count == 414140LL) { + printf("Here I go\n"); + } + if (vsc_count > 500000) exit(0); + if (gc_calls < 1) return; +#endif #if defined(__GNUC__) - fprintf(Yap_stderr,"%llu %p", vsc_count, B); + fprintf(Yap_stderr,"%llu ", vsc_count); #endif /* check_trail_consistency(); */ if (pred == NULL) { diff --git a/pl/modules.yap b/pl/modules.yap index 50821ee14..6d58e5681 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -423,9 +423,9 @@ module(N) :- '$system_predicate'(G,M), !, '$c_built_in'(G,M,Gi), (Gi \== G -> - '$module_expansion'(Gi,Gi,G2,M,CM,TM,HVars) ; - TM = M -> - G2 = G, G1 = G, + '$module_expansion'(Gi,Gi,G2,M,CM,TM,HVars) + ; TM = M -> + G2 = G, G1 = G ; G2 = M:G, G1 = M:G % atts: ).