ObjectWrapper is not safe, and in any case incompatible with .NET 5.
This commit is contained in:
Rolf Bjarne Kvinge 2020-05-04 11:08:49 +02:00
Родитель ab50886e47
Коммит ef8a5736a2
3 изменённых файлов: 0 добавлений и 39 удалений

Просмотреть файл

@ -94,14 +94,6 @@ This has the same problem as xamarin_invoke_trampoline,
having to construct parameters to a managed function
while at the same time being able to switch to safe mode.
ObjectWrapper
-------------
This is not safe, and must be replaced with safe alternatives:
* icall
* GCHandle
Debugging tips
==============

Просмотреть файл

@ -1,30 +0,0 @@
using System;
using System.Runtime.InteropServices;
namespace ObjCRuntime {
[StructLayout(LayoutKind.Explicit)]
internal struct ObjectWrapper {
[FieldOffset(0)] object obj;
[FieldOffset(0)] IntPtr handle;
internal static IntPtr Convert (object obj) {
if (obj == null)
return IntPtr.Zero;
ObjectWrapper wrapper = new ObjectWrapper ();
wrapper.obj = obj;
return wrapper.handle;
}
internal static object Convert (IntPtr ptr)
{
ObjectWrapper wrapper = new ObjectWrapper ();
wrapper.handle = ptr;
return wrapper.obj;
}
}
}

Просмотреть файл

@ -1778,7 +1778,6 @@ SHARED_SOURCES = \
ObjCRuntime/Method.cs \
ObjCRuntime/MethodDescription.cs \
ObjCRuntime/NSStringMarshal.cs \
ObjCRuntime/ObjectWrapper.cs \
ObjCRuntime/Registrar.cs \
ObjCRuntime/ReleaseAttribute.cs \
ObjCRuntime/RequiredFrameworkAttribute.cs \