Compartir a través de


ObjectiveCMarshal.Initialize Método

Definición

Inicialice la API de serialización de Objective-C.

public:
 static void Initialize(delegate* unmanaged<void> ^ beginEndCallback, delegate* unmanaged<IntPtr , int> ^ isReferencedCallback, delegate* unmanaged<IntPtr , void> ^ trackedObjectEnteredFinalization, System::Runtime::InteropServices::ObjectiveC::ObjectiveCMarshal::UnhandledExceptionPropagationHandler ^ unhandledExceptionPropagationHandler);
public static void Initialize (delegate* unmanaged<void> beginEndCallback, delegate* unmanaged<IntPtr, int> isReferencedCallback, delegate* unmanaged<IntPtr, void> trackedObjectEnteredFinalization, System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.UnhandledExceptionPropagationHandler unhandledExceptionPropagationHandler);
static member Initialize : delegate* unmanaged<unit> * delegate* unmanaged<nativeint, int> * delegate* unmanaged<nativeint, unit> * System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.UnhandledExceptionPropagationHandler -> unit
Public Shared Sub Initialize (beginEndCallback As delegate* unmanaged<Void>, isReferencedCallback As delegate* unmanaged< As IntPtr, Integer>, trackedObjectEnteredFinalization As delegate* unmanaged< As IntPtr, Void>, unhandledExceptionPropagationHandler As ObjectiveCMarshal.UnhandledExceptionPropagationHandler)

Parámetros

beginEndCallback
delegate* unmanaged<Void>

Se llama cuando comienza y finaliza el seguimiento.

isReferencedCallback

delegate* unmanaged<IntPtr, Int32>

delegate* unmanaged<nativeint, Int32>

Se llama para determinar si se hace referencia a una instancia de objeto administrado en otro lugar y no la debe recopilar el GC.

trackedObjectEnteredFinalization

delegate* unmanaged<IntPtr, Void>

delegate* unmanaged<nativeint, Void>

Se llama cuando un objeto con seguimiento entra en la cola de finalización.

unhandledExceptionPropagationHandler
ObjectiveCMarshal.UnhandledExceptionPropagationHandler

Controlador para la propagación de excepciones no controladas a través de un límite nativo administrado> (es decir, P/Invoke inverso).

Comentarios

Todos los punteros de función no administrados deben escribirse en código nativo, ya que el GC los llamará y el código administrado no podrá ejecutarse en ese momento.

beginEndCallback Se llamará cuando comience y finalice el seguimiento de referencias. El par de inicio y fin asociado nunca se anidará. Al usar GC de estación de trabajo, se llamará al par de inicio y finalización en el mismo subproceso. Cuando se usa GC de servidor, no se garantiza que se llame al par de inicio y finalización en el mismo subproceso.

isReferencedCallback Debe devolver 0 para no hacer referencia o 1 para hacer referencia a . Cualquier otro valor tiene un comportamiento indefinido.

Se aplica a