diff --git a/C/absmi.c b/C/absmi.c index cfee8f273..da4277f44 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -10,8 +10,12 @@ * * * File: absmi.c * * comments: Portable abstract machine interpreter * -* Last rev: $Date: 2007-06-04 12:28:01 $,$Author: vsc $ * +* Last rev: $Date: 2007-09-24 09:02:31 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.223 2007/06/04 12:28:01 vsc +* interface speedups +* bad error message in X is foo>>2. +* * Revision 1.222 2007/05/01 21:18:19 vsc * fix bug in saving P at p_eq (obs from Frabrizio Riguzzi) * @@ -1468,7 +1472,8 @@ Yap_absmi(int inp) /* enter logical pred */ BOp(alloc_for_logical_pred, EC); - /* say that an environment is using this clause */ + check_trail(TR); + /* say that an environment is using this clause */ /* we have our own copy for the clause */ #if defined(YAPOR) || defined(THREADS) { @@ -8093,6 +8098,7 @@ Yap_absmi(int inp) /* enter logical pred */ BOp(enter_lu_pred, Ill); + check_trail(TR); /* mark the indexing code */ { LogUpdIndex *cl = PREG->u.Ill.I; diff --git a/C/globals.c b/C/globals.c index 39c03cd47..47c8fcc79 100644 --- a/C/globals.c +++ b/C/globals.c @@ -303,6 +303,16 @@ GrowArena(Term arena, CELL *pt, UInt old_size, UInt size, UInt arity) } size = size/sizeof(CELL); arena = XREGS[arity+1]; +#if 0 + /* try to recover some room */ + if (arena == GlobalArena) { + if (!Yap_gc(arity+1, ENV, P)) { + Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); + return FALSE; + } + } + arena = XREGS[arity+1]; +#endif } CreateNewArena(ArenaPt(arena), size+old_size); return TRUE; @@ -856,17 +866,6 @@ CopyTermToArena(Term t, Term arena, int share, UInt arity, Term *newarena, Term case -1: if (arena == GlobalArena) GlobalArenaOverflows++; - /* handle arena overflow */ - /* first, take care of useless stuff */ - /* - if (!Yap_gc(arity+4, ENV, P)) { - Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage); - return 0L; - } - arena = XREGS[arity+2]; - newarena = (Term *)XREGS[arity+3]; - old_top = ArenaLimit(*newarena); - */ if (!GrowArena(arena, old_top, old_size, min_grow, arity+4)) { Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage); return 0L;