projects
/
pintos-anon
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Modify the linker script to match the generated binary
[pintos-anon]
/
src
/
tests
/
lib.pm
1
use strict;
2
use warnings;
3
4
use tests::random;
5
6
sub shuffle {
7
my ($in, $cnt, $sz) = @_;
8
$cnt * $sz == length $in or die;
9
my (@a) = 0...$cnt - 1;
10
for my $i (0...$cnt - 1) {
11
my ($j) = $i + random_ulong () % ($cnt - $i);
12
@a[$i, $j] = @a[$j, $i];
13
}
14
my ($out) = "";
15
$out .= substr ($in, $_ * $sz, $sz) foreach @a;
16
return $out;
17
}
18
19
1;