Skip to content

Commit f59605c

Browse files
committed
In CI set the GC interval to 1 for Linux only
1 parent d61d4c6 commit f59605c

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@v3
3636

37+
- name: Set the tag GC interval to 1 on linux
38+
if: runner.os == 'macOS'
39+
run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV
40+
3741
# We install gnu-tar because BSD tar is buggy on macOS builders of GHA.
3842
# See <https://github.com/actions/cache/issues/403>.
3943
- name: Install GNU tar

ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function run_tests {
3131
# optimizations up all the way).
3232
# Optimizations change diagnostics (mostly backtraces), so we don't check them
3333
#FIXME(#2155): we want to only run the pass and panic tests here, not the fail tests.
34-
MIRIFLAGS="-O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
34+
MIRIFLAGS="${MIRIFLAGS:-} -O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
3535
fi
3636

3737
## test-cargo-miri

src/machine.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
10151015

10161016
fn before_terminator(ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
10171017
ecx.machine.basic_block_count += 1u64; // a u64 that is only incremented by 1 will "never" overflow
1018+
ecx.machine.since_gc += 1;
10181019
// Possibly report our progress.
10191020
if let Some(report_progress) = ecx.machine.report_progress {
10201021
if ecx.machine.basic_block_count % u64::from(report_progress) == 0 {
@@ -1028,13 +1029,9 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
10281029
// stacks.
10291030
// When debug assertions are enabled, run the GC as often as possible so that any cases
10301031
// where it mistakenly removes an important tag become visible.
1031-
if cfg!(debug_assertions)
1032-
|| (ecx.machine.gc_interval > 0 && ecx.machine.since_gc >= ecx.machine.gc_interval)
1033-
{
1032+
if ecx.machine.gc_interval > 0 && ecx.machine.since_gc >= ecx.machine.gc_interval {
10341033
ecx.machine.since_gc = 0;
10351034
ecx.garbage_collect_tags()?;
1036-
} else {
1037-
ecx.machine.since_gc += 1;
10381035
}
10391036

10401037
// These are our preemption points.

0 commit comments

Comments
 (0)