Exemplo n.º 1
0
        // Note that this overload does not handle varargs
        private static bool IsArgPassedByRef(TypeHandle th)
        {
            //        LIMITED_METHOD_CONTRACT;

            Debug.Assert(!th.IsNull());

            // This method only works for valuetypes. It includes true value types, 
            // primitives, enums and TypedReference.
            Debug.Assert(th.IsValueType());

            uint size = th.GetSize();
#if _TARGET_AMD64_
            return IsArgPassedByRef((int)size);
#elif _TARGET_ARM64_
            // Composites greater than 16 bytes are passed by reference
            return ((size > ArchitectureConstants.ENREGISTERED_PARAMTYPE_MAXSIZE) && !th.IsHFA());
#else
#error ArgIterator::IsArgPassedByRef
#endif
        }
Exemplo n.º 2
0
 unsafe public static int GetElemSize(CorElementType t, TypeHandle thValueType)
 {
     if (((int)t) <= 0x1d)
     {
         int elemSize = s_elemSizes[(int)t];
         if (elemSize == -1)
         {
             return (int)thValueType.GetSize();
         }
         if (elemSize == -2)
         {
             return IntPtr.Size;
         }
         return elemSize;
     }
     return 0;
 }