Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3
This commit is contained in:
commit
7ce65dcfa3
1
C/qlyr.c
1
C/qlyr.c
@ -793,6 +793,7 @@ ReadHash(IOSTREAM *stream)
|
||||
}
|
||||
RCHECK(read_tag(stream) == QLY_START_DBREFS);
|
||||
LOCAL_ImportDBRefHashTableNum = read_uint(stream);
|
||||
fprintf(stderr,"reading %ld\n",LOCAL_ImportDBRefHashTableNum);
|
||||
for (i = 0; i < LOCAL_ImportDBRefHashTableNum; i++) {
|
||||
LogUpdClause *ocl = (LogUpdClause *)read_uint(stream);
|
||||
UInt sz = read_uint(stream);
|
||||
|
4
C/qlyw.c
4
C/qlyw.c
@ -457,6 +457,7 @@ SaveHash(IOSTREAM *stream)
|
||||
}
|
||||
save_tag(stream, QLY_START_DBREFS);
|
||||
save_uint(stream, LOCAL_ExportDBRefHashTableNum);
|
||||
fprintf(stderr,"exporting %ld\n",LOCAL_ImportDBRefHashTableNum);
|
||||
for (i = 0; i < LOCAL_ExportDBRefHashTableSize; i++) {
|
||||
export_dbref_hash_entry_t *p = LOCAL_ExportDBRefHashChain[i];
|
||||
while (p) {
|
||||
@ -742,6 +743,9 @@ p_save_program( USES_REGS1 )
|
||||
if (!(stream = Yap_GetOutputStream(AtomOfTerm(t1))) ) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!(stream = Yap_GetOutputStream(AtomOfTerm(t1))) ) {
|
||||
return FALSE;
|
||||
}
|
||||
return save_program(stream) != 0;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ static void
|
||||
send_tracer_message(char *start, char *name, Int arity, char *mname, CELL *args)
|
||||
{
|
||||
CACHE_REGS
|
||||
fprintf(GLOBAL_stderr, "(%p) ", B);
|
||||
if (name == NULL) {
|
||||
#ifdef YAPOR
|
||||
fprintf(GLOBAL_stderr, "(%d)%s", worker_id, start);
|
||||
@ -145,9 +146,6 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
||||
LOCK(Yap_heap_regs->low_level_trace_lock);
|
||||
sc = Yap_heap_regs;
|
||||
vsc_count++;
|
||||
if (vsc_count == 1719615) jmp_deb(1);
|
||||
if (vsc_count < 1719600)
|
||||
return;
|
||||
#ifdef THREADS
|
||||
LOCAL_ThreadHandle.thread_inst_count++;
|
||||
#endif
|
||||
|
@ -95,7 +95,7 @@ otherwise.
|
||||
'profile.yap',
|
||||
'callcount.yap',
|
||||
'load_foreign.yap',
|
||||
'save.yap',
|
||||
% 'save.yap',
|
||||
'setof.yap',
|
||||
'sort.yap',
|
||||
'statistics.yap',
|
||||
|
15
pl/qly.yap
15
pl/qly.yap
@ -16,17 +16,28 @@
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
save_program(File) :-
|
||||
qsave_program(File).
|
||||
|
||||
qsave_program(File) :-
|
||||
'$save_program_status',
|
||||
open(File, write, S, [type(binary)]),
|
||||
'$qsave_program'(S),
|
||||
close(S).
|
||||
|
||||
save_program(File, Goal) :-
|
||||
recorda('$restore_goal', Goal ,_R),
|
||||
fail.
|
||||
save_program(File, _Goal) :-
|
||||
writeln(here),
|
||||
qsave_program(File).
|
||||
|
||||
'$save_program_status' :-
|
||||
findall(F:V,'$x_yap_flag'(F,V),L),
|
||||
recordz('$program_state',L,_).
|
||||
|
||||
% there is some ordering between flags.
|
||||
'$x_yap_flag'(goal, Goal).
|
||||
'$x_yap_flag'(language, V).
|
||||
'$x_yap_flag'(X, V) :-
|
||||
yap_flag(X, V),
|
||||
@ -162,8 +173,6 @@ qsave_program(File) :-
|
||||
'$myddas_import_all'.
|
||||
|
||||
|
||||
|
||||
|
||||
qsave_module(Mod) :-
|
||||
recorded('$module', '$module'(F,Mod,Exps), _),
|
||||
'$fetch_parents_module'(Mod, Parents),
|
||||
@ -180,7 +189,7 @@ qsave_module(Mod) :-
|
||||
fail.
|
||||
qsave_module(_).
|
||||
|
||||
qload_program(File) :-
|
||||
restore(File) :-
|
||||
open(File, read, S, [type(binary)]),
|
||||
'$qload_program'(S),
|
||||
close(S).
|
||||
|
66
pl/utils.yap
66
pl/utils.yap
@ -310,72 +310,6 @@ getenv(Na,Val) :-
|
||||
setenv(Na,Val) :-
|
||||
'$putenv'(Na,Val).
|
||||
|
||||
%%% Saving and restoring a computation
|
||||
|
||||
save(A) :- save(A,_).
|
||||
|
||||
save(A,_) :- var(A), !,
|
||||
'$do_error'(instantiation_error,save(A)).
|
||||
save(A,OUT) :- atom(A), !, atom_codes(A,S), '$save'(S,OUT).
|
||||
save(S,OUT) :- '$save'(S,OUT).
|
||||
|
||||
save_program(A) :- var(A), !,
|
||||
'$do_error'(instantiation_error,save_program(A)).
|
||||
save_program(A) :- atom(A), !,
|
||||
atom_codes(A,S),
|
||||
'$save_program2'(S, true).
|
||||
save_program(S) :- '$save_program2'(S, true).
|
||||
|
||||
save_program(A, G) :- var(A), !,
|
||||
'$do_error'(instantiation_error, save_program(A,G)).
|
||||
save_program(A, G) :- var(G), !,
|
||||
'$do_error'(instantiation_error, save_program(A,G)).
|
||||
save_program(A, G) :- \+ callable(G), !,
|
||||
'$do_error'(type_error(callable,G), save_program(A,G)).
|
||||
save_program(A, G) :-
|
||||
( atom(A) -> atom_codes(A,S) ; A = S),
|
||||
'$save_program2'(S, G),
|
||||
fail.
|
||||
save_program(_,_).
|
||||
|
||||
'$save_program2'(S,G) :-
|
||||
(
|
||||
G == true
|
||||
->
|
||||
true
|
||||
;
|
||||
recorda('$restore_goal', G ,R)
|
||||
),
|
||||
(
|
||||
'$undefined'(reload_foreign_libraries, shlib)
|
||||
->
|
||||
true
|
||||
;
|
||||
recorda('$reload_foreign_libraries', true, R1)
|
||||
),
|
||||
'$save_program'(S),
|
||||
(
|
||||
var(R1)
|
||||
->
|
||||
true
|
||||
;
|
||||
erase(R1)
|
||||
),
|
||||
(
|
||||
var(R)
|
||||
->
|
||||
true
|
||||
;
|
||||
erase(R)
|
||||
),
|
||||
fail.
|
||||
'$save_program2'(_,_).
|
||||
|
||||
restore(A) :- var(A), !,
|
||||
'$do_error'(instantiation_error,restore(A)).
|
||||
restore(A) :- atom(A), !, name(A,S), '$restore'(S).
|
||||
restore(S) :- '$restore'(S).
|
||||
|
||||
prolog :-
|
||||
'$live'.
|
||||
|
||||
|
Reference in New Issue
Block a user