Skip to content

Commit 3269f01

Browse files
committed
TEST: Make AGC margin tests work in single threaded version.
1 parent 9f7e765 commit 3269f01

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/core/test_agc_margin.pl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
% run without the GC thread. Everything is restored afterwards: the text
7474
% margin is global state shared with the rest of the suite.
7575

76+
:- if(current_prolog_flag(threads, true)).
7677
setup_agc(state(Thread, Margin)) :-
7778
current_prolog_flag(gc_thread, Thread),
7879
blob_type_property(text, gc_margin(Margin)),
@@ -83,6 +84,17 @@
8384
set_blob_type(text, gc_margin(Margin)),
8485
set_prolog_flag(gc_thread, Thread).
8586

87+
:- else.
88+
89+
setup_agc(state(Margin)) :-
90+
blob_type_property(text, gc_margin(Margin)),
91+
garbage_collect_atoms.
92+
93+
cleanup_agc(state(Margin)) :-
94+
set_blob_type(text, gc_margin(Margin)).
95+
96+
:- endif.
97+
8698

8799
:- begin_tests(agc_margin_api).
88100

0 commit comments

Comments
 (0)