Normally, I use functionPointer like this
JumpFunc = BurstCompiler.CompileFunctionPointer<ScopeCalculator.JumpDelegate>(ScopeCalculator.GetMotherScope);
And I invoke JumpFunc in bursted code.That worked.
Today I try to convert managed delegate to functionPointer like this
ScopeCalculator.JumpDelegate newDelegate =
new ScopeCalculator.JumpDelegate(ScopeCalculator.GetMotherScopeManaged);
JumpFunc = new FunctionPointer<ScopeCalculator.JumpDelegate>(
Marshal.GetFunctionPointerForDelegate(newDelegate));
It worked too, and I can use managed type such as string in GetMotherScopeManaged. There is no burst compile error, and I confirmed the code which invoke this functionPointer is bursted.
So is there any problem in this way Like causing memory leak or something woring?