Ejemplo n.º 1
0
        public static void writeString(this IMemoryRange range, ref ulong point, string value)
        {
            var size = value.Length;

            range.write(point++, size);
            for (var i = 0; i != size; i++)
            {
                range.write(point++, MarshalChar(value[i]));
            }
        }
Ejemplo n.º 2
0
            public VMRef Write(IMemoryRange range)
            {
                var(free, start) = range.GetFreeAddress();
                range.writeString(ref free, "main.module");
                range.writeString(ref free, Name);
                range.write(free++, Args.Length);
                foreach (var arg in Args)
                {
                    range.writeString(ref free, arg.Type.Name.Replace("_Type", ""));
                    range.write(free++, arg.Value);
                }
                range.writeString(ref free, ReturnType.ShortName);

                return(new VMRef(start, (free - start)));
            }