private object _InvokeRustFunction(string methodName, params object[] args) { // Rust側のインスタンスの関数を呼び出す var methodName1 = System.Text.Encoding.UTF8.GetBytes(methodName); var args1 = args.Select(InstancePool.AppendInstance) .ToArray(); unsafe { fixed(UInt64 *a = args1) fixed(byte *b = methodName1) { var res = Internal.unibridge_invoke(_rustInstance, new Slice <char>((char *)b, (UIntPtr)methodName1.Length), new Slice <UInt64>(a, (UIntPtr)args1.Length)); var res1 = InstancePool.GetInstance(res); InstancePool.DisposeInstance(res); return(res1); } } }