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
511134f55ff17330da315f9f3da1702366c31921
godot/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/GeneratorClasses.cs

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: 1791ms Template: 198ms
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