// (changed not to print anything and lower the total iterations; ported to
// Tango)
-import tango.core.Memory;
+// Total residency should be ~160 MiB, but it usually increases a lot because
+// of false positives (probably in the static memory area)
+
import tango.math.random.Random;
+const N = 2_000_000;
+const L = 20;
+const I = 50; // original: 200
+
int main(char[][] args)
{
int[][] stuff;
- int NUM = 2_000_000;
-
- stuff.length = 20;
-
- GC.disable();
+ stuff.length = L;
auto rand = new Random();
- for(int i = 0; i < 200; i++) {
- int[] arr = new int[NUM];
+ for(int i = 0; i < I; i++) {
+ int[] arr = new int[N];
for(int j = 0; j < arr.length; j++) {
rand(arr[j]);
zig = rand.uniform!(int) % stuff.length;
stuff[zig] = arr;
-
- if (i == 20) {
- GC.enable();
- }
}
return 0;