예제 #1
0
        public Struct64 Copy64RefOut()
        {
            Struct64 s = new Struct64();

            s.Value1        = new Struct32();
            s.Value2        = new Struct32();
            s.Value1.Value1 = new Struct8();
            s.Value1.Value2 = new Struct8();
            s.Value1.Value3 = new Struct8();
            s.Value1.Value4 = new Struct8();

            s.Value2.Value1 = new Struct8();
            s.Value2.Value2 = new Struct8();
            s.Value2.Value3 = new Struct8();
            s.Value2.Value4 = new Struct8();

            s.Value1.Value1.Value1 = 1;
            s.Value1.Value1.Value2 = 2;
            s.Value1.Value2.Value1 = 3;
            s.Value1.Value2.Value2 = 4;
            s.Value1.Value3.Value1 = 5;
            s.Value1.Value3.Value2 = 6;
            s.Value1.Value4.Value1 = 7;
            s.Value1.Value4.Value2 = 8;

            s.Value2.Value1.Value1 = 9;
            s.Value2.Value1.Value2 = 10;
            s.Value2.Value2.Value1 = 11;
            s.Value2.Value2.Value2 = 12;
            s.Value2.Value3.Value1 = 13;
            s.Value2.Value3.Value2 = 14;
            s.Value2.Value4.Value1 = 15;
            s.Value2.Value4.Value2 = 16;

            for (int i = 0; i < 100.000; i++)
            {
                CopyBackRefOut(ref s, out s);
            }

            return(s);
        }
예제 #2
0
        public void StructSize64()
        {
            for (int i = 0; i < _struct64.Length; i++)
            {
                Struct64 s = _struct64[i];
                s.Value1        = new Struct32();
                s.Value2        = new Struct32();
                s.Value1.Value1 = new Struct8();
                s.Value1.Value2 = new Struct8();
                s.Value1.Value3 = new Struct8();
                s.Value1.Value4 = new Struct8();

                s.Value2.Value1 = new Struct8();
                s.Value2.Value2 = new Struct8();
                s.Value2.Value3 = new Struct8();
                s.Value2.Value4 = new Struct8();

                s.Value1.Value1.Value1 = i;
                s.Value1.Value1.Value2 = i;
                s.Value1.Value2.Value1 = i;
                s.Value1.Value2.Value2 = i;
                s.Value1.Value3.Value1 = i;
                s.Value1.Value3.Value2 = i;
                s.Value1.Value4.Value1 = i;
                s.Value1.Value4.Value2 = i;

                s.Value2.Value1.Value1 = i;
                s.Value2.Value1.Value2 = i;
                s.Value2.Value2.Value1 = i;
                s.Value2.Value2.Value2 = i;
                s.Value2.Value3.Value1 = i;
                s.Value2.Value3.Value2 = i;
                s.Value2.Value4.Value1 = i;
                s.Value2.Value4.Value2 = i;

                _struct64[i] = s;
            }
        }
예제 #3
0
 private void CopyBackRefOut(ref Struct64 c, out Struct64 o)
 {
     o = c;
 }
예제 #4
0
 private Struct64 CopyBackRef(ref Struct64 c)
 {
     return(c);
 }
예제 #5
0
 private Struct64 CopyBack(Struct64 c)
 {
     return(c);
 }