Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,24 @@ internal unsafe static class RuntimeNativeMethods
[DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool clr_typemap_java_to_managed (string java_type_name, out IntPtr managed_assembly_name, out uint managed_type_token_id);

/// <summary>
/// Initialize GC bridge for managed processing mode (no native background thread).
/// Returns the mark_cross_references function pointer to pass to JavaMarshal.Initialize.
/// </summary>
[DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern delegate* unmanaged<MarkCrossReferencesArgs*, void> clr_initialize_gc_bridge (
delegate* unmanaged<MarkCrossReferencesArgs*, void> bridge_processing_started_callback,
delegate* unmanaged<MarkCrossReferencesArgs*, void> bridge_processing_finished_callback);
internal static extern delegate* unmanaged<MarkCrossReferencesArgs*, void> clr_gc_bridge_initialize_for_managed_processing ();

/// <summary>
/// Wait for the next set of cross references to process. Blocks until mark_cross_references is called by the GC.
/// </summary>
[DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern MarkCrossReferencesArgs* clr_gc_bridge_wait_for_processing ();

/// <summary>
/// Trigger Java garbage collection.
/// </summary>
[DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)]
internal static extern void clr_gc_bridge_trigger_java_gc ();

[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern void monodroid_unhandled_exception (Exception javaException);
Expand Down
Loading