public static void PassByValue(ref ValueTypeCounter c1, RefTypeCounter c2)
 {
     c1.Inc();
     c2.Inc();
     CallInc(c1);
     CallInc(c2);
 }
        public static void Ref(ref ValueTypeCounter l, ref ValueTypeCounter r)
        {
            ValueTypeCounter t = l;

            l = r;
            r = t;
        }
        public static int Initobj(int a)
        {
            ValueTypeCounter c1 = new ValueTypeCounter();

            c1.Inc();
            ValueTypeCounter          c2 = new ValueTypeCounter(a);
            ValueTypeCounterContainer cc = new ValueTypeCounterContainer();

            cc.Init(a);
            return(c1.Val + c2.Val + cc.c.Val);
        }
 public static int Ldflda(ref ValueTypeCounter c)
 {
     intref(ref c.i);
     return(c.i);
 }
 public static string VirtualFuncOfStruct(ValueTypeCounter vtc)
 {
     return(vtc.ToString() + ",hashcode:" + vtc.GetHashCode());
 }
 static void CallInc(ValueTypeCounter counter)
 {
     counter.Inc();
 }
 public void Init(int a)
 {
     c   = new ValueTypeCounter();
     c.i = a;
 }