[tests] Test loading references from LoadFrom and LoadFile contexts
[mono-project.git] / mono / tests / gc-copy-stress.cs
blob130f33f8284c74bd08475395d64f49c18a731e28
1 using System;
3 class T {
5 static int count = 1000000;
6 static int loops = 20;
7 static int persist_factor = 10;
9 static object obj;
11 static object[] persist;
12 static int persist_idx;
14 static void work () {
15 persist = new object[count / persist_factor + 1];
16 persist_idx = 0;
17 for (int i = 0; i < count; ++i) {
18 obj = new object ();
19 if (i % persist_factor == 0)
20 persist[persist_idx++] = obj;
24 static void Main (string[] args) {
25 if (args.Length > 0)
26 loops = int.Parse (args [0]);
27 if (args.Length > 1)
28 count = int.Parse (args [1]);
29 if (args.Length > 2)
30 persist_factor = int.Parse (args [2]);
31 for (int i = 0; i < loops; ++i) {
32 work ();