Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / profiler / test-heapshot.cs
1 using System;
2
3 class T {
4         T next;
5
6         static void Main (string[] args) {
7                 int count = 5000;
8                 T list = null;
9                 for (int i = 0; i < count; ++i) {
10                         T n = new T ();
11                         n.next = list;
12                         list = n;
13                 }
14                 // trigger a heapshot
15                 GC.Collect ();
16                 for (int i = 0; i < 23; ++i) {
17                         T n = new T ();
18                         n.next = list;
19                         list = n;
20                 }
21                 // trigger another heapshot
22                 GC.Collect ();
23         }
24 }
25