Пример #1
0
        public static DebugThreadLocalMapGetOrReserve GenerateDebugThreadLocalMapGetOrReserve(IntPtr structPtr)
        {
            EmitterContext context = new EmitterContext();

            var result = WindowsPartialUnmapHandler.EmitThreadLocalMapIntGetOrReserve(context, structPtr, context.LoadArgument(OperandType.I32, 0), context.LoadArgument(OperandType.I32, 1));

            context.Return(result);

            // Compile and return the function.

            ControlFlowGraph cfg = context.GetControlFlowGraph();

            OperandType[] argTypes = new OperandType[] { OperandType.I64 };

            return(Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq).Map <DebugThreadLocalMapGetOrReserve>());
        }
Пример #2
0
        public static DebugPartialUnmap GenerateDebugPartialUnmap()
        {
            EmitterContext context = new EmitterContext();

            var result = WindowsPartialUnmapHandler.EmitRetryFromAccessViolation(context);

            context.Return(result);

            // Compile and return the function.

            ControlFlowGraph cfg = context.GetControlFlowGraph();

            OperandType[] argTypes = new OperandType[] { OperandType.I64 };

            return(Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq).Map <DebugPartialUnmap>());
        }