File: spesh-bisect.pl

package info (click to toggle)
moarvm 2020.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 18,652 kB
  • sloc: ansic: 268,178; perl: 8,186; python: 1,316; makefile: 768; sh: 287
file content (20 lines) | stat: -rwxr-xr-x 348 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env perl

use 5.10.0;

chomp $prog;
my $min = 1;
my $max = 100000;
my $l = 50000;
while ($min < $l and $l < $max) {
    $ENV{MVM_SPESH_LIMIT} = $l;
    say "Trying $l";
    if (system(@ARGV) != 0) {
        $max = $l - 1;
    }
    else {
        $min = $l + 1
    };
    $l = $min + int(($max - $min) / 2);
};
say "MVM_SPESH_LIMIT=$l";