fix excessive trail cleaning in gc tr overflow.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1853 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2007-03-21 23:23:46 +00:00
parent e27d2fa1f3
commit 51e0e2f54e
2 changed files with 22 additions and 5 deletions

View File

@ -51,6 +51,7 @@ STATIC_PROTO(void compact_heap, (void));
STATIC_PROTO(void update_relocation_chain, (CELL *, CELL *));
STATIC_PROTO(int is_gc_verbose, (void));
STATIC_PROTO(int is_gc_very_verbose, (void));
STATIC_PROTO(void set_conditionals, (tr_fr_ptr));
#include "heapgc.h"
@ -156,6 +157,7 @@ gc_growtrail(int committed, tr_fr_ptr begsTR, cont *old_cont_top0)
begsTR = newsTR;
sTR += 2;
}
set_conditionals(sTR);
}
#endif
/* could not find more trail */
@ -3602,13 +3604,10 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop)
TR = OldTR;
*--ASP = (CELL)current_env;
#ifdef EASY_SHUNTING
set_conditionals(sTR);
#endif
if (
!Yap_growtrail(sz, FALSE)
) {
Yap_Error(OUT_OF_TRAIL_ERROR,TermNil,"out of %lB during gc", 64*1024L);
Yap_Error(OUT_OF_TRAIL_ERROR,TermNil,"out of %lB during gc", sz);
return -1;
} else {
total_marked = 0;

View File

@ -11,8 +11,11 @@
* File: index.c *
* comments: Indexing a Prolog predicate *
* *
* Last rev: $Date: 2007-01-28 14:26:36 $,$Author: vsc $ *
* Last rev: $Date: 2007-03-21 23:23:46 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.182 2007/01/28 14:26:36 vsc
* WIN32 support
*
* Revision 1.181 2007/01/08 08:27:19 vsc
* fix restore (Trevor)
* make indexing a bit faster on IDB
@ -7797,6 +7800,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
return (LogUpdClause *)static_clause(ipc->u.l.l, ap);
break;
case _try_clause:
#if TABLING
case _table_try:
#endif
if (b0 == NULL)
store_clause_choice_point(Terms[0], Terms[1], Terms[2], NEXTOP(ipc,ld), ap, ap_pc, cp_pc);
else {
@ -7823,6 +7829,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
else
return (LogUpdClause *)static_clause(ipc->u.l.l, ap);
case _try_me:
#if TABLING
case _table_try_me:
#endif
if (b0 == NULL)
store_clause_choice_point(Terms[0], Terms[1], Terms[2], ipc->u.ld.d, ap, ap_pc, cp_pc);
else {
@ -7837,6 +7846,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
ipc = NEXTOP(ipc,p);
break;
case _retry:
#if TABLING
case _table_retry:
#endif
update_clause_choice_point(NEXTOP(ipc,ld),ap_pc);
if (lu_pred)
return lu_clause(ipc->u.ld.d);
@ -7855,6 +7867,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
ipc = NEXTOP(ipc,ld);
break;
case _trust:
#if TABLING
case _table_trust:
#endif
#ifdef CUT_C
{
while (POP_CHOICE_POINT(B->cp_b))
@ -7881,6 +7896,9 @@ Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3], yamop *ap_pc, y
case _profiled_trust_me:
case _trust_me:
case _count_trust_me:
#if TABLING
case _table_trust_me:
#endif
b0 = B;
#ifdef CUT_C
{