fix YAPOR THREADS. fix threads + tabling.
This commit is contained in:
parent
791106aa05
commit
e319b2fbf9
@ -4110,7 +4110,7 @@ Proc E_Modules[]= {/* init_fc,*/ (Proc) 0 };
|
|||||||
|
|
||||||
#ifndef YAPOR
|
#ifndef YAPOR
|
||||||
static
|
static
|
||||||
Int p_yapor_threads(void) {
|
Int p_yapor_threads( USES_REGS1 ) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -173,8 +173,9 @@ void Yap_init_local_optyap_data(int wid) {
|
|||||||
INIT_LOCK(REMOTE_lock_signals(wid));
|
INIT_LOCK(REMOTE_lock_signals(wid));
|
||||||
#endif /* YAPOR_COPY */
|
#endif /* YAPOR_COPY */
|
||||||
Set_REMOTE_prune_request(wid, NULL);
|
Set_REMOTE_prune_request(wid, NULL);
|
||||||
#endif /* YAPOR */
|
|
||||||
INIT_LOCK(REMOTE_lock(wid));
|
INIT_LOCK(REMOTE_lock(wid));
|
||||||
|
#endif /* YAPOR */
|
||||||
|
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
/* local data related to tabling */
|
/* local data related to tabling */
|
||||||
REMOTE_next_free_ans_node(wid) = NULL;
|
REMOTE_next_free_ans_node(wid) = NULL;
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
** **
|
** **
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
#ifdef TABLING
|
#if defined(TABLING) || defined(YAPOR)
|
||||||
#include "SWI-Stream.h"
|
#include "SWI-Stream.h"
|
||||||
#endif /* TABLING */
|
#endif /* TABLING || YAPOR */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -523,7 +523,7 @@ static inline void rebind_variables(tr_fr_ptr rebind_tr, tr_fr_ptr end_tr) {
|
|||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
TABLING_ERROR_CHECKING(rebind_variables, rebind_tr < end_tr);
|
TABLING_ERROR_CHECKING(rebind_variables, rebind_tr < end_tr);
|
||||||
/* rebind loop */
|
/* rebind loop */
|
||||||
Yap_NEW_MAHASH((ma_h_inner_struct *)H);
|
Yap_NEW_MAHASH((ma_h_inner_struct *)H PASS_REGS);
|
||||||
while (rebind_tr != end_tr) {
|
while (rebind_tr != end_tr) {
|
||||||
CELL ref = (CELL) TrailTerm(--rebind_tr);
|
CELL ref = (CELL) TrailTerm(--rebind_tr);
|
||||||
/* check for global or local variables */
|
/* check for global or local variables */
|
||||||
@ -541,7 +541,7 @@ static inline void rebind_variables(tr_fr_ptr rebind_tr, tr_fr_ptr end_tr) {
|
|||||||
#ifdef MULTI_ASSIGNMENT_VARIABLES
|
#ifdef MULTI_ASSIGNMENT_VARIABLES
|
||||||
} else {
|
} else {
|
||||||
CELL *cell_ptr = RepAppl(ref);
|
CELL *cell_ptr = RepAppl(ref);
|
||||||
if (!Yap_lookup_ma_var(cell_ptr)) {
|
if (!Yap_lookup_ma_var(cell_ptr PASS_REGS)) {
|
||||||
/* first time we found the variable, let's put the new value */
|
/* first time we found the variable, let's put the new value */
|
||||||
*cell_ptr = TrailVal(rebind_tr);
|
*cell_ptr = TrailVal(rebind_tr);
|
||||||
}
|
}
|
||||||
@ -560,7 +560,7 @@ static inline void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) {
|
|||||||
|
|
||||||
TABLING_ERROR_CHECKING(restore_variables, unbind_tr < rebind_tr);
|
TABLING_ERROR_CHECKING(restore_variables, unbind_tr < rebind_tr);
|
||||||
end_tr = rebind_tr;
|
end_tr = rebind_tr;
|
||||||
Yap_NEW_MAHASH((ma_h_inner_struct *)H);
|
Yap_NEW_MAHASH((ma_h_inner_struct *)H PASS_REGS);
|
||||||
while (unbind_tr != end_tr) {
|
while (unbind_tr != end_tr) {
|
||||||
/* unbind loop */
|
/* unbind loop */
|
||||||
while (unbind_tr > end_tr) {
|
while (unbind_tr > end_tr) {
|
||||||
@ -582,7 +582,7 @@ static inline void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) {
|
|||||||
/* multi-assignment variable */
|
/* multi-assignment variable */
|
||||||
/* so that the upper cell is the old value */
|
/* so that the upper cell is the old value */
|
||||||
--unbind_tr;
|
--unbind_tr;
|
||||||
if (!Yap_lookup_ma_var(pt)) {
|
if (!Yap_lookup_ma_var(pt PASS_REGS)) {
|
||||||
pt[0] = TrailVal(unbind_tr);
|
pt[0] = TrailVal(unbind_tr);
|
||||||
}
|
}
|
||||||
#endif /* MULTI_ASSIGNMENT_VARIABLES */
|
#endif /* MULTI_ASSIGNMENT_VARIABLES */
|
||||||
|
Reference in New Issue
Block a user