In CI set the GC interval to 1 for Linux only
This commit is contained in:
parent
d61d4c6af7
commit
f59605ce52
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -34,6 +34,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set the tag GC interval to 1 on linux
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV
|
||||||
|
|
||||||
# We install gnu-tar because BSD tar is buggy on macOS builders of GHA.
|
# We install gnu-tar because BSD tar is buggy on macOS builders of GHA.
|
||||||
# See <https://github.com/actions/cache/issues/403>.
|
# See <https://github.com/actions/cache/issues/403>.
|
||||||
- name: Install GNU tar
|
- name: Install GNU tar
|
||||||
|
2
ci.sh
2
ci.sh
@ -31,7 +31,7 @@ function run_tests {
|
|||||||
# optimizations up all the way).
|
# optimizations up all the way).
|
||||||
# Optimizations change diagnostics (mostly backtraces), so we don't check them
|
# Optimizations change diagnostics (mostly backtraces), so we don't check them
|
||||||
#FIXME(#2155): we want to only run the pass and panic tests here, not the fail tests.
|
#FIXME(#2155): we want to only run the pass and panic tests here, not the fail tests.
|
||||||
MIRIFLAGS="-O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
|
MIRIFLAGS="${MIRIFLAGS:-} -O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test -- tests/{pass,panic}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## test-cargo-miri
|
## test-cargo-miri
|
||||||
|
@ -1015,6 +1015,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
|
|||||||
|
|
||||||
fn before_terminator(ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
|
fn before_terminator(ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
|
||||||
ecx.machine.basic_block_count += 1u64; // a u64 that is only incremented by 1 will "never" overflow
|
ecx.machine.basic_block_count += 1u64; // a u64 that is only incremented by 1 will "never" overflow
|
||||||
|
ecx.machine.since_gc += 1;
|
||||||
// Possibly report our progress.
|
// Possibly report our progress.
|
||||||
if let Some(report_progress) = ecx.machine.report_progress {
|
if let Some(report_progress) = ecx.machine.report_progress {
|
||||||
if ecx.machine.basic_block_count % u64::from(report_progress) == 0 {
|
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> {
|
|||||||
// stacks.
|
// stacks.
|
||||||
// When debug assertions are enabled, run the GC as often as possible so that any cases
|
// When debug assertions are enabled, run the GC as often as possible so that any cases
|
||||||
// where it mistakenly removes an important tag become visible.
|
// where it mistakenly removes an important tag become visible.
|
||||||
if cfg!(debug_assertions)
|
if ecx.machine.gc_interval > 0 && ecx.machine.since_gc >= ecx.machine.gc_interval {
|
||||||
|| (ecx.machine.gc_interval > 0 && ecx.machine.since_gc >= ecx.machine.gc_interval)
|
|
||||||
{
|
|
||||||
ecx.machine.since_gc = 0;
|
ecx.machine.since_gc = 0;
|
||||||
ecx.garbage_collect_tags()?;
|
ecx.garbage_collect_tags()?;
|
||||||
} else {
|
|
||||||
ecx.machine.since_gc += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are our preemption points.
|
// These are our preemption points.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user