From a1a4771ac1de95f2410c7fb8dfaf4a5986e5ebc6 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 23 Jan 2023 19:37:53 -0300 Subject: Remove use of GetFunctionPointerForDelegate to get JIT cache function pointer (#4337) * Remove use of GetFunctionPointerForDelegate to get JIT cache function pointer * Rename FuncPtr to FuncPointer --- ARMeilleure/CodeGen/CompiledFunction.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ARMeilleure/CodeGen/CompiledFunction.cs') diff --git a/ARMeilleure/CodeGen/CompiledFunction.cs b/ARMeilleure/CodeGen/CompiledFunction.cs index ab5e88eb..0560bf2e 100644 --- a/ARMeilleure/CodeGen/CompiledFunction.cs +++ b/ARMeilleure/CodeGen/CompiledFunction.cs @@ -48,9 +48,21 @@ namespace ARMeilleure.CodeGen /// A delegate of type pointing to the mapped function public T Map() { - IntPtr codePtr = JitCache.Map(this); + return MapWithPointer(out _); + } + + /// + /// Maps the onto the and returns a delegate of type + /// pointing to the mapped function. + /// + /// Type of delegate + /// Pointer to the function code in memory + /// A delegate of type pointing to the mapped function + public T MapWithPointer(out IntPtr codePointer) + { + codePointer = JitCache.Map(this); - return Marshal.GetDelegateForFunctionPointer(codePtr); + return Marshal.GetDelegateForFunctionPointer(codePointer); } } } \ No newline at end of file -- cgit v1.2.3