5a874dec8528b5ecbc505f5e576e1800f10bf5e0
[mono.git] / samples / size / sample.cs
1 using System;
2 using Mono.ObjectServices;
3
4 class Demo {
5     int a;
6         static void Main ()
7         {
8                 Demo d = new Demo ();
9
10                 prints ("d", d);
11                 prints ("dd", new DD ());
12         }
13
14         static void prints (string s, object x)
15         {
16                 Console.WriteLine ("size of " + s + ":" + ObjectInspector.GetMemoryUsage (x));
17         }
18 }
19
20 class DD {
21     Demo d = new Demo ();
22     object [] o = new object [10];
23 }