From 6c126a4392e803d0cdd82f9cd98c6d6bca2ab591 Mon Sep 17 00:00:00 2001 From: vsc Date: Fri, 31 Oct 2003 12:09:49 +0000 Subject: [PATCH] get rid of MBIT in dbase git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@914 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/corout.c | 2 +- C/dbase.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/C/corout.c b/C/corout.c index babadb6c8..ceece5fc9 100644 --- a/C/corout.c +++ b/C/corout.c @@ -1160,7 +1160,7 @@ non_ground(Term t, Term *Var) #endif /* check whether the two terms unify and return what variables should - be bound before the terms are execatly equal */ + be bound before the terms are exactly equal */ static Int p_can_unify(void) { #ifdef COROUTINING diff --git a/C/dbase.c b/C/dbase.c index b189a303c..8b8dad9d8 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -626,6 +626,9 @@ copy_big_int(CELL *st, CELL *pt) } #endif /* BIG_INT */ +#define DB_MARKED(d0) ((CELL *)(d0) < CodeMax && (CELL *)(d0) >= tbase) + + /* This routine creates a complex term in the heap. */ static CELL *MkDBTerm(register CELL *pt0, register CELL *pt0_end, register CELL *StoPoint, @@ -827,7 +830,7 @@ static CELL *MkDBTerm(register CELL *pt0, register CELL *pt0_end, /* the code to dereference a variable */ deref_var: - if (!MARKED(d0)) { + if (!DB_MARKED(d0)) { if ( #if SBA d0 != 0 @@ -847,14 +850,14 @@ static CELL *MkDBTerm(register CELL *pt0, register CELL *pt0_end, pt0++; /* first time we found this variable! */ - if (!MARKED(d0)) { + if (!DB_MARKED(d0)) { /* store previous value */ visited --; visited->addr = ptd0; CheckDBOverflow(); /* variables need to be offset at read time */ - *ptd0 = ((CELL)StoPoint|MBIT); + *ptd0 = (CELL)StoPoint; #if SBA /* the copy we keep will be an empty variable */ *StoPoint++ = 0; @@ -911,9 +914,9 @@ static CELL *MkDBTerm(register CELL *pt0, register CELL *pt0_end, #endif /* store the offset */ #ifdef IDB_USE_MBIT - *StoPoint = d0; + *StoPoint = d0 | MBIT; #else - *StoPoint = d0 ^ MBIT; + *StoPoint = d0; #endif StoPoint++; continue;