From 4b91f13ee1b04b610f5e7ebdba155b3f6b065936 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Jun 2009 09:47:17 -0500 Subject: [PATCH] allow easy shunting, but make sure we do not shunt chains below the current CP. --- C/heapgc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C/heapgc.c b/C/heapgc.c index a9c243cba..f0ab9e114 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -24,7 +24,7 @@ static char SccsId[] = "%W% %G%"; #include "attvar.h" #if !defined(TABLING) -/* #define EASY_SHUNTING 1 */ +#define EASY_SHUNTING 1 #endif /* !TABLING */ #define HYBRID_SCHEME 1 @@ -1221,13 +1221,15 @@ mark_variable(CELL_PTR current) current = next; } } - } else if (IsVarTerm(cnext) && + /* try to shorten chains if they go through the current CP */ + } else if (next > HB && + IsVarTerm(cnext) && UNMARK_CELL(cnext) != (CELL)next && current < LCL0) { /* This step is possible because we clean up the trail */ *current = UNMARK_CELL(cnext); UNMARK(current); - if (current >= H0 && current < H) { + if (current >= H0 && current < H ) { total_marked--; if (current < HGEN) { total_oldies--;