Logo
Explore Help
Sign In
northern-lighthouse/godot
1
0
Fork 0
You've already forked godot
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
cb1569345a6f17da08241e645ab03cb2e1b78d2f
godot/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/GeneratorClasses.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
215 B
C#
Raw Normal View History

C#: Replace P/Invoke with delegate pointers - Moves interop functions to UnmanagedCallbacks struct that contains the function pointers and is passed to C#. - Implements UnmanagedCallbacksGenerator, a C# source generator that generates the UnmanagedCallbacks struct in C# and the body for the NativeFuncs methods (their implementation just calls the function pointer in the UnmanagedCallbacks). The generated methods are needed because .NET pins byref parameters of native calls, even if they are 'ref struct's, which don't need pinning. The generated methods use `Unsafe.AsPointer` so that we can benefit from byref parameters without suffering overhead of pinning. Co-authored-by: Raul Santos <raulsntos@gmail.com>
2022-08-05 03:32:59 +02:00
namespace Godot.SourceGenerators.Internal;
internal static class GeneratorClasses
{
public const string GenerateUnmanagedCallbacksAttr = "Godot.SourceGenerators.Internal.GenerateUnmanagedCallbacksAttribute";
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.1 Page: 524ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API