|
From: Vitor S. C. <vs...@us...> - 2001-06-11 15:12:10
|
Update of /cvsroot/yap/OPTYap
In directory usw-pr-cvs1:/tmp/cvs-serv31838/OPTYap
Modified Files:
opt.preds.c
Log Message:
support for configure 2.5
recover memory in catch/throw.
Index: opt.preds.c
===================================================================
RCS file: /cvsroot/yap/OPTYap/opt.preds.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- opt.preds.c 2001/05/28 19:54:53 1.2
+++ opt.preds.c 2001/06/11 15:12:07 1.3
@@ -35,12 +35,12 @@
** Local functions declaration **
** ------------------------------------- */
+static int p_default_sequential(void);
#ifdef YAPOR
static realtime current_time(void);
static int yapor_on(void);
static int start_yapor(void);
static int p_sequential(void);
-static int p_default_sequential(void);
static int p_execution_mode(void);
static int p_performance(void);
static int p_parallel_new_answer(void);
@@ -106,7 +106,40 @@
** Local functions **
** ------------------------- */
+static
+int p_default_sequential(void) {
#ifdef YAPOR
+ Term t;
+ t = Deref(ARG1);
+ if (IsVarTerm(t)) {
+ Term ta;
+ if (SEQUENTIAL_IS_DEFAULT)
+ ta = MkAtomTerm(LookupAtom("on"));
+ else
+ ta = MkAtomTerm(LookupAtom("off"));
+ Bind((CELL *)t, ta);
+ return(TRUE);
+ }
+ if (IsAtomTerm(t)) {
+ char *s;
+ s = RepAtom(AtomOfTerm(t))->StrOfAE;
+ if (strcmp(s, "on") == 0) {
+ SEQUENTIAL_IS_DEFAULT = TRUE;
+ return(TRUE);
+ }
+ if (strcmp(s,"off") == 0) {
+ SEQUENTIAL_IS_DEFAULT = FALSE;
+ return(TRUE);
+ }
+ }
+ return(FALSE);
+#else
+ return(TRUE);
+#endif
+}
+
+
+#ifdef YAPOR
static
realtime current_time(void) {
/* to get time as Yap */
@@ -171,35 +204,6 @@
pe = RepPredProp(PredProp(at, arity));
pe->PredFlags |= SequentialPredFlag;
return (TRUE);
-}
-
-
-static
-int p_default_sequential(void) {
- Term t;
- t = Deref(ARG1);
- if (IsVarTerm(t)) {
- Term ta;
- if (SEQUENTIAL_IS_DEFAULT)
- ta = MkAtomTerm(LookupAtom("on"));
- else
- ta = MkAtomTerm(LookupAtom("off"));
- Bind((CELL *)t, ta);
- return(TRUE);
- }
- if (IsAtomTerm(t)) {
- char *s;
- s = RepAtom(AtomOfTerm(t))->StrOfAE;
- if (strcmp(s, "on") == 0) {
- SEQUENTIAL_IS_DEFAULT = TRUE;
- return(TRUE);
- }
- if (strcmp(s,"off") == 0) {
- SEQUENTIAL_IS_DEFAULT = FALSE;
- return(TRUE);
- }
- }
- return(FALSE);
}
|