コード例 #1
0
        protected override JitAsmResultScope JitCompileAndGetMethods(MemoryStream assemblyStream)
        {
            CustomAssemblyLoadContext?context = null;

            try {
                context = new CustomAssemblyLoadContext(shouldShareAssembly: _ => true);
                var assembly = context.LoadFromStream(assemblyStream);
                var results  = IsolatedJitAsmDecompilerCore.JitCompileAndGetMethods(assembly);
                return(new JitAsmResultScope(results, context));
            }
            catch {
                context?.Dispose();
                throw;
            }
        }
コード例 #2
0
            public static IReadOnlyList <MethodJitResult> GetCompiledMethods(byte[] assemblyBytes)
            {
                var assembly = Assembly.Load(assemblyBytes);

                return(IsolatedJitAsmDecompilerCore.JitCompileAndGetMethods(assembly));
            }