Skip to content

Commit

Permalink
Merge pull request #171 from AppliedLogicSystems/fix-freeze-gc
Browse files Browse the repository at this point in the history
Fix freeze gc
  • Loading branch information
kenbowen authored Oct 14, 2019
2 parents 6c85dda + 0ce3d67 commit 3a60f6e
Show file tree
Hide file tree
Showing 14 changed files with 421 additions and 675 deletions.
23 changes: 22 additions & 1 deletion core/alsp_src/builtins/blt_frez.pro
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,28 @@ subst_var(Term, V, W, Result)

subst_var(Term, V, W, Term).

#if (not(all_procedures(syscfg,intconstr,0,_)))

'$combine_dvars'(R,F)
:-
%% F is the senior var;
'$delay_term_for'(R, R_DelayTerm),
arg(4, R_DelayTerm, R_Constr),

'$delay_term_for'(F, F_DelayTerm),
arg(4, F_DelayTerm, F_Constr),

subst_var(F_Constr, F, NewVar, NewF_Constr),
subst_var(R_Constr, R, NewVar, NewR_Constr),

arg(3, F_DelayTerm, F_Mod),
arg(3, R_DelayTerm, R_Mod),

'$delay'(NewVar,F_Mod,(NewF_Constr, (R_Mod:NewR_Constr)),_),
'$bind_vars'(F, NewVar),
'$bind_vars'(R, NewVar).

#endif

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% For showanswers, and relatives:
Expand Down Expand Up @@ -193,7 +215,6 @@ exhibit_var(Var)
printf(Stream, '\n<Var> = %t', [Var]).

:-dynamic(freeze_disp_vns/0).
%freeze_disp_vns.

export show_delay_binding/4.
show_delay_binding(N, S, VPairs, Stream)
Expand Down
7 changes: 0 additions & 7 deletions core/alsp_src/builtins/blt_shl.pro
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,6 @@ prolog_shell_loop(Wins,InStream,OutStream)
prolog_shell_loop(Wins,InStream,OutStream).

prolog_shell_loop(_,_,_).
/*
prolog_shell_loop(Wins,InStream,OutStream)
:-
write(prolog_shell_loop_2),nl,flush_output.
*/

export shell_read_execute/4.
shell_read_execute(InStream,OutStream,Wins,Status)
Expand Down Expand Up @@ -651,14 +646,12 @@ do_shell_query(Goal0,VarNames,Vars,Wins,AlarmIntrv,InStream,OutStream)
setRetry(0), %% and Retry in case of debugging.
xform_command_or_query(Goal0,Goal1),
do_shell_query2(user,Goal1),
% dbg_notrace,
dbg_spyoff,
showanswers(VarNames,Vars,Wins,InStream,OutStream),
!.

do_shell_query(Goal,VarNames,Vars,Wins,AlarmIntrv,InStream,OutStream)
:-
% dbg_notrace,
dbg_spyoff,
print_no(OutStream).

Expand Down
2 changes: 1 addition & 1 deletion core/alsp_src/builtins/builtins.pro
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export getPrologInterrupt/1.
clct_tr(ActiveDelays),
%pbi_write(active_delays=ActiveDelays), pbi_nl, pbi_ttyflush,
delay_handler(ActiveDelays),
%pbi_write('--------$interrupt-3---delay_handler-DONE'), pbi_nl, pbi_ttyflush,
%pbi_write('--------$interrupt-3---delay_handler-DONE-call'=(M:G)), pbi_nl, pbi_ttyflush,
M:G.

%% -------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions core/alsp_src/generic/built.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ static struct blt_struct {
BLT("display_item_addr", 1, disp_item, "_disp_item"),
BLT("swp_tr", 0, pbi_swp_tr, "_pbi_swp_tr"),
BLT("walk_cps", 0, pbi_walk_cps, "_pbi_walk_cps"),
BLT("cptz", 0, pbi_cptz, "_pbi_cptz"),
BLT("x_display_heap", 2, x_disp_heap, "_x_disp_heap"),
BLT("x_swp_tr", 0, pbi_x_swp_tr, "_pbi_x_swp_tr"),
#endif /* DEBUGSYS */
/* SPECIAL -- Freeze-related */
#ifdef FREEZE
Expand Down
3 changes: 3 additions & 0 deletions core/alsp_src/generic/built.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ extern int pbi_clct_tr PARAMS(( void ));
extern int pbi_unset_2nd PARAMS(( void ));
extern int pbi_del_tm_for PARAMS(( void ));
extern int pbi_bind_vars PARAMS(( void ));
extern int pbi_cptz PARAMS(( void ));
extern int x_disp_heap PARAMS(( void ));
extern int pbi_x_swp_tr PARAMS(( void ));

#ifdef INTCONSTR

Expand Down
3 changes: 3 additions & 0 deletions core/alsp_src/generic/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@
| System-Level Debugging
*---------------------------------------------------------------------*/

//#define DEBUGSYS 1
#define PRIM_DBG 1

#ifdef DEBUGSYS
#include "debugsys.h"
#endif
Expand Down
1 change: 1 addition & 0 deletions core/alsp_src/generic/dfltsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@
#undef OLDCONSULT

#define FREEZE 1
//#define DEBUGSYS 1
Loading

0 comments on commit 3a60f6e

Please sign in to comment.