File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ EXPORTS
36
36
coreclr_unity_profiler_register
37
37
coreclr_unity_profiler_class_get_assembly_load_context_handle
38
38
coreclr_unity_profiler_get_managed_assembly_load_context
39
+ coreclr_unity_profiler_assembly_load_context_get_loader_allocator_handle
39
40
coreclr_unity_profiler_loader_allocator_get_assembly_load_context_handle
40
41
coreclr_unity_gc_concurrent_mode
41
42
mono_assembly_get_assemblyref
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ coreclr_unity_class_array_element_size
22
22
coreclr_unity_profiler_register
23
23
coreclr_unity_profiler_class_get_assembly_load_context_handle
24
24
coreclr_unity_profiler_get_managed_assembly_load_context
25
+ coreclr_unity_profiler_assembly_load_context_get_loader_allocator_handle
25
26
coreclr_unity_profiler_loader_allocator_get_assembly_load_context_handle
26
27
coreclr_unity_gc_concurrent_mode
27
28
mono_assembly_get_assemblyref
Original file line number Diff line number Diff line change @@ -789,6 +789,26 @@ extern "C" EXPORT_API ObjectHandleID EXPORT_CC coreclr_unity_profiler_get_manage
789
789
return (ObjectHandleID)pAssemblyBinder->GetManagedAssemblyLoadContext ();
790
790
}
791
791
792
+ extern " C" EXPORT_API ObjectHandleID EXPORT_CC coreclr_unity_profiler_assembly_load_context_get_loader_allocator_handle (ObjectID assemblyLoadContextObjectID)
793
+ {
794
+ STATIC_CONTRACT_NOTHROW;
795
+
796
+ ASSEMBLYLOADCONTEXTREF pAssemblyLoadContext = (ASSEMBLYLOADCONTEXTREF)assemblyLoadContextObjectID;
797
+ if (pAssemblyLoadContext == NULL )
798
+ return NULL ;
799
+
800
+ AssemblyBinder* pAssemblyBinder = (AssemblyBinder*)pAssemblyLoadContext->GetNativeAssemblyBinder ();
801
+ if (pAssemblyBinder == NULL )
802
+ return NULL ;
803
+
804
+ LoaderAllocator* loaderAllocator = pAssemblyBinder->GetLoaderAllocator ();
805
+ if (loaderAllocator == NULL )
806
+ return NULL ;
807
+
808
+ // ManagedAssemblyLoadContext is a handle to the managed AssemblyLoadContext object
809
+ return (ObjectHandleID)loaderAllocator->GetLoaderAllocatorObjectHandle ();
810
+ }
811
+
792
812
// Return the AssemblyLoadContext handle for the given LoaderAllocator checking whether or not LoaderAllocator is still alive.
793
813
// LoaderAllocator is the main object that tracks AssemblyLoadContext liveness as AssemblyLoadContext is a simple wrapper around a native
794
814
// reference to LoaderAllocator.
You can’t perform that action at this time.
0 commit comments