[src] Remove ObjectWrapper.
ObjectWrapper is not safe, and in any case incompatible with .NET 5.
This commit is contained in:
Родитель
ab50886e47
Коммит
ef8a5736a2
|
@ -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 \
|
||||
|
|
Загрузка…
Ссылка в новой задаче