Skip to content

Instantly share code, notes, and snippets.

View stevewoolcock's full-sized avatar

Dead Reckoned stevewoolcock

  • Melbourne, Australia
View GitHub Profile
@Jura-Z
Jura-Z / Burst2ManagedCall.cs
Last active June 17, 2023 18:05
Burst -> Managed C# call
internal static class Burst2ManagedCall<T, Key>
{
private static T s_Delegate;
// alignment 16 is important to not crash on arm cpu
private static readonly SharedStatic<FunctionPointer<T>> s_SharedStatic = SharedStatic<FunctionPointer<T>>.GetOrCreate<FunctionPointer<T>, Key>(16);
public static bool IsCreated => s_SharedStatic.Data.IsCreated;
public static void Init(T @delegate)
{
CheckIsNotCreated();