public static void InsertCode(this CodeGen codeGen, ILinkingInfo myFixer, long position, Action <CodeGen> insertAction) { var insertCode = new CodeGen(); insertAction(insertCode); myFixer.Insert(position, insertCode.GetBufferSpan().Length); codeGen.Insert(insertCode.GetBufferSpan(), position); }
public static void InsertCode( this CodeGen codeGen, ILinkingInfo myFixer, long position, ReadOnlySpan <byte> data, ILinkingInfo otherFixer = null ) { myFixer.Insert(position, data.Length); otherFixer?.CopyTo(myFixer, position); codeGen.Insert(data, position); }