File: spesh-bisect.pl

package info (click to toggle)
moarvm 2018.12%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 18,196 kB
  • sloc: ansic: 223,172; perl: 7,638; sh: 4,452; makefile: 1,089; python: 568; asm: 8
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";