From b8d0396939d7c1212010d8823cdf468c234abebc Mon Sep 17 00:00:00 2001 From: vsc Date: Mon, 31 Oct 2005 12:27:54 +0000 Subject: [PATCH] more small fixes git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1431 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/arith0.c | 6 +++--- C/arith1.c | 2 +- C/save.c | 20 ++++++++++++++++++-- C/tracer.c | 1 - OPTYap/opt.config.h | 6 +++--- changes-5.1.html | 5 +++++ configure.in | 8 ++------ library/ypp.yap | 4 ++-- 8 files changed, 34 insertions(+), 18 deletions(-) diff --git a/C/arith0.c b/C/arith0.c index 9c21cb19c..e840e99fb 100644 --- a/C/arith0.c +++ b/C/arith0.c @@ -242,13 +242,13 @@ Yap_ReInitConstExps(void) AtomEntry *ae = RepAtom(Yap_FullLookupAtom(InitConstTab[i].OpName)); WRITE_LOCK(ae->ARWLock); - if ((p = Yap_GetExpPropHavingLock(ae, 0)) == NULL) { + if (!(p = Yap_GetExpPropHavingLock(ae, 0))) { WRITE_UNLOCK(ae->ARWLock); - return(FALSE); + return FALSE; } RepExpProp(p)->FOfEE.constant = InitConstTab[i].f; WRITE_UNLOCK(ae->ARWLock); } - return(TRUE); + return TRUE; } diff --git a/C/arith1.c b/C/arith1.c index 37b8a7d86..47fc9aaa4 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -2110,7 +2110,7 @@ Yap_ReInitUnaryExps(void) WRITE_LOCK(ae->ARWLock); if ((p = Yap_GetExpPropHavingLock(ae, 1)) == NULL) { WRITE_UNLOCK(ae->ARWLock); - return(FALSE); + return FALSE; } RepExpProp(p)->FOfEE.unary = InitUnTab[i].f; WRITE_UNLOCK(ae->ARWLock); diff --git a/C/save.c b/C/save.c index 0015626e7..b11467175 100644 --- a/C/save.c +++ b/C/save.c @@ -408,6 +408,11 @@ save_regs(int mode) #ifdef COROUTINING putout(DelayedVars); #endif +#if defined(SBA) || defined(TABLING) + putcellptr(H_FZ); + putcellptr((CELL *)B_FZ); + putcellptr((CELL *)TR_FZ); +#endif /* SBA || TABLING */ } putout(CurrentModule); if (mode == DO_EVERYTHING) { @@ -464,7 +469,7 @@ save_heap(void) { int j; /* Then save the whole heap */ -#if defined(YAPOR) || defined(TABLING) +#if defined(YAPOR) || defined(TABLING) && !defined(YAP_MEMORY_ALLOC_SCHEME) /* skip the local and global data structures */ j = Unsigned(&GLOBAL) - Unsigned(Yap_HeapBase); putout(j); @@ -798,6 +803,17 @@ get_regs(int flag) if (Yap_ErrorMessage) return -1; #endif +#if defined(SBA) || defined(TABLING) + H_FZ = get_cellptr(); + if (Yap_ErrorMessage) + return -1; + B_FZ = (choiceptr)get_cellptr(); + if (Yap_ErrorMessage) + return -1; + TR_FZ = (tr_fr_ptr)get_cellptr(); + if (Yap_ErrorMessage) + return -1; +#endif /* SBA || TABLING */ } CurrentModule = get_cell(); if (Yap_ErrorMessage) @@ -875,7 +891,7 @@ get_hash(void) static int CopyCode(void) { -#if defined(YAPOR) || defined(TABLING) +#if (defined(YAPOR) || defined(TABLING)) && !defined(YAP_MEMORY_ALLOC_SCHEME) /* skip the local and global data structures */ CELL j = get_cell(); if (Yap_ErrorMessage) diff --git a/C/tracer.c b/C/tracer.c index 8ced8fa31..b14830800 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -181,7 +181,6 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) #if defined(THREADS) || defined(YAPOR) fprintf(Yap_stderr,"(%d)", worker_id); #endif - fprintf(Yap_stderr," %x ", Yap_ReadTimedVar(WokenGoals)); /* check_trail_consistency(); */ if (pred == NULL) return; diff --git a/OPTYap/opt.config.h b/OPTYap/opt.config.h index 78a489ea7..e8f44277f 100644 --- a/OPTYap/opt.config.h +++ b/OPTYap/opt.config.h @@ -5,7 +5,7 @@ Copyright: R. Rocha and NCC - University of Porto, Portugal File: opt.config.h - version: $Id: opt.config.h,v 1.9 2005-08-04 15:45:54 ricroc Exp $ + version: $Id: opt.config.h,v 1.10 2005-10-31 12:27:54 vsc Exp $ **********************************************************************/ @@ -26,8 +26,8 @@ /* ----------------------------------------- ** ** memory alloc scheme (define one) ** ** ----------------------------------------- */ -#define SHM_MEMORY_ALLOC_SCHEME 1 -/* #define YAP_MEMORY_ALLOC_SCHEME 1 */ +/* #define SHM_MEMORY_ALLOC_SCHEME 1 */ +#define YAP_MEMORY_ALLOC_SCHEME 1 /* #define MALLOC_MEMORY_ALLOC_SCHEME 1 */ /* ------------------------------------------- ** diff --git a/changes-5.1.html b/changes-5.1.html index f4eb54227..4bf07bc46 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -16,6 +16,11 @@

Yap-5.1.0: