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])); } }
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))); }