Example #1
0
        // Shortcut
//		internal void LoadClr(Type t) => Load(t, Clr.Value.ClrSymbols);

        // Shortcut
//		internal void LoadAllClr(Type[] t) => LoadAll(t, Clr.Value.ClrSymbols);

        #region Load field

        private static object CopyInField(ImportFieldAttribute ifld, MetaField field, Pointer <byte> ptr)
        {
            var type = field.FieldType.RuntimeType;

            int size = ifld.SizeConst;

            if (size == Constants.INVALID_VALUE)
            {
                size = Unsafe.SizeOf(type, SizeOfOptions.BaseData);
            }

            byte[] mem = ptr.CopyBytes(size);

            return(Converter.AllocRaw(mem, type));
        }