small fixes for CUT_C
This commit is contained in:
parent
995e8f6dc7
commit
139fc6c440
11
C/grow.c
11
C/grow.c
@ -157,16 +157,16 @@ SetHeapRegs(void)
|
||||
UNLOCK(SignalLock);
|
||||
if (H)
|
||||
H = PtoGloAdjust(H);
|
||||
#ifdef CUT_C
|
||||
if (Yap_REGS.CUT_C_TOP)
|
||||
Yap_REGS.CUT_C_TOP = CutCAdjust(Yap_REGS.CUT_C_TOP);
|
||||
#endif
|
||||
if (HB)
|
||||
HB = PtoGloAdjust(HB);
|
||||
if (B)
|
||||
B = ChoicePtrAdjust(B);
|
||||
if (CurrentDelayTop)
|
||||
CurrentDelayTop = PtoDelayAdjust(CurrentDelayTop);
|
||||
#ifdef CUT_C
|
||||
if (Yap_REGS.CUT_C_TOP)
|
||||
Yap_REGS.CUT_C_TOP = (cut_c_str_ptr)ChoicePtrAdjust((choiceptr)Yap_REGS.CUT_C_TOP);
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
if (B_FZ)
|
||||
B_FZ = ChoicePtrAdjust(B_FZ);
|
||||
@ -1730,6 +1730,9 @@ Yap_CopyThreadStacks(int worker_q, int worker_p)
|
||||
if (ASP > CellPtr(B))
|
||||
ASP = CellPtr(B);
|
||||
LCL0 = ThreadHandle[worker_p].current_yaam_regs->LCL0_;
|
||||
#ifdef CUT_C
|
||||
Yap_REGS.CUT_C_TOP = ThreadHandle[worker_p].current_yaam_regs->CUT_C_TOP;
|
||||
#endif
|
||||
DelayedVars = ThreadHandle[worker_p].current_yaam_regs->DelayedVars_;
|
||||
TR = ThreadHandle[worker_p].current_yaam_regs->TR_;
|
||||
CurrentDelayTop = (CELL *)DelayTop();
|
||||
|
6
C/init.c
6
C/init.c
@ -806,6 +806,12 @@ Yap_InitCPredBackCut(char *Name, unsigned long int Arity,
|
||||
CPredicate Cont,CPredicate Cut, UInt flags){
|
||||
Yap_InitCPredBack_(Name,Arity,Extra,Start,Cont,Cut,flags);
|
||||
}
|
||||
#else
|
||||
Yap_InitCPredBackCut(char *Name, unsigned long int Arity,
|
||||
unsigned int Extra, CPredicate Start,
|
||||
CPredicate Cont,CPredicate Cut, UInt flags){
|
||||
Yap_InitCPredBack(Name,Arity,Extra,Start,Cont,flags);
|
||||
}
|
||||
#endif /* CUT_C */
|
||||
|
||||
void
|
||||
|
@ -228,8 +228,8 @@ void STD_PROTO(Yap_InitCPred,(char *, unsigned long int, CPredicate, UInt));
|
||||
void STD_PROTO(Yap_InitAsmPred,(char *, unsigned long int, int, CPredicate, UInt));
|
||||
void STD_PROTO(Yap_InitCmpPred,(char *, unsigned long int, CmpPredicate, UInt));
|
||||
void STD_PROTO(Yap_InitCPredBack,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,UInt));
|
||||
#ifdef CUT_C
|
||||
void STD_PROTO(Yap_InitCPredBackCut,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,UInt));
|
||||
#ifdef CUT_C
|
||||
void STD_PROTO(Yap_InitCPredBack_,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,UInt));
|
||||
#endif
|
||||
void STD_PROTO(Yap_InitWorkspace,(UInt,UInt,UInt,UInt,UInt,int,int,int));
|
||||
|
@ -515,9 +515,11 @@ Yap_unify_constant(register Term a, register Term cons)
|
||||
|
||||
static inline int
|
||||
do_cut(int i) {
|
||||
#ifdef CUT_C
|
||||
while (POP_CHOICE_POINT(B->cp_b)) {
|
||||
cut_c_pop();
|
||||
}
|
||||
#endif
|
||||
Yap_TrimTrail();
|
||||
B = B->cp_b;
|
||||
return i;
|
||||
|
@ -106,6 +106,15 @@ PtoLocAdjust (CELL * ptr)
|
||||
}
|
||||
|
||||
|
||||
inline EXTERN struct cut_c_str *CutCAdjust (struct cut_c_str *);
|
||||
|
||||
inline EXTERN struct cut_c_str *
|
||||
CutCAdjust (struct cut_c_str * ptr)
|
||||
{
|
||||
return (struct cut_c_str *) (CharP (ptr) + LDiff);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline EXTERN choiceptr ChoicePtrAdjust (choiceptr);
|
||||
|
||||
|
Reference in New Issue
Block a user