コード例 #1
0
        private static void FastLoadField(MetaField fieldInfo, Pointer <byte> addr, Pointer <byte> fieldAddr)
        {
            int fieldSize = fieldInfo.Size;

            byte[] memCpy = addr.CopyBytes(fieldSize);
            fieldAddr.WriteAll(memCpy);
        }
コード例 #2
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));
        }