#Burst UnmanagedCallersOnly
1 messages · Page 1 of 1 (latest)
Not part of 2022.2 but we'll see where the future goes 2023+. As it has already landed in our version of mono:
https://github.com/Unity-Technologies/mono/pull/1772
So the official answer is no, UnmanagedCallersOnly is not supported in Unity yet, even in Unity 2023 versions. With that said, it might work, let me explain:
We're currently working to bring CoreCLR and new .NET support to Unity. The UnmanagedCallersOnly attribute is a big part of that, allowing us to get excellent performance for code that crosses the native/managed boundary. So we are iteratively implementing support in Burst, IL2CPP, and Mono as we need it. Once there is a Unity release will full CoreCLR support, UnmanagedCallersOnly will also be fully supported. So you're seeing some implementation details of our current development work leak here. I would hold off until we have a full release though, as the current support is only what we need now, so there may be cases where it doesn't work completely.
🤔 So in future call method from managed land to unmanaged dots land will near to zero overhead?