]> Repositorios git - scryer-prolog.git/commitdiff
roll back extent of heap when loads are complete in loader.pl
authorMark Thom <[email protected]>
Thu, 11 Feb 2021 22:37:43 +0000 (15:37 -0700)
committerMark Thom <[email protected]>
Thu, 11 Feb 2021 22:37:43 +0000 (15:37 -0700)
src/loader.pl

index 01fc23f493e094fa4c784711729c93d6ae50a5ba..0abd573c8f7ead4f5f52343aafa2e46e5c884e1d 100644 (file)
@@ -85,7 +85,9 @@ run_initialization_goals :-
     ).
 
 file_load(Stream, Path) :-
-    file_load(Stream, Path, _).
+    file_load(Stream, Path, _),
+    false.        %% Clear the heap.
+file_load(_, _).
 
 file_load(Stream, Path, Evacuable) :-
     create_file_load_context(Stream, Path, Evacuable),
@@ -104,7 +106,9 @@ load(Stream) :-
           builtins:(loader:unload_evacuable(Evacuable),
                            builtins:throw(E))),
     run_initialization_goals,
-    '$pop_load_context'.
+    '$pop_load_context',
+    false.        %% Clear the heap.
+load(_).
 
 load_loop(Stream, Evacuable) :-
     read_term(Stream, Term, [variable_names(VNs), singletons(Singletons)]),