[loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects (#18457)
[mono-project.git] / samples / size / sample.cs
blobae4256bf43573d2568fbd7af58b540283f68123d
1 using System;
2 using Mono.ObjectServices;
4 class Demo {
6 int a;
8 static void Main ()
10 Demo d = new Demo ();
12 prints ("d", d);
13 prints ("dd", new DD ());
14 prints ("short str", "short");
15 prints ("long str", "this is a longer string which we want to measure the size of");
17 object[] obj_array = new object [100];
19 prints ("obj array", obj_array);
21 for (int i = 0; i < 100; i++)
22 obj_array [i] = new Demo ();
24 prints ("obj array w/ demos", obj_array);
27 static void prints (string s, object x)
29 Console.WriteLine ("size of " + s + ":" + ObjectInspector.GetMemoryUsage (x));
33 class DD {
34 Demo d = new Demo ();
35 object [] o = new object [10];
36 char [] ch = new char [10];
37 int junk;
39 public DD ()
41 o [0] = new Demo ();
42 o [5] = new Demo ();