Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
  • Loading branch information
AustinWise and AaronRobinsonMSFT authored Dec 5, 2022
1 parent a7a6a9b commit 7cbf935
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public static unsafe partial class ObjectiveCMarshal
private static readonly IntPtr[] s_ObjcMessageSendFunctions = new IntPtr[(int)MessageSendFunction.MsgSendSuperStret + 1];
private static bool s_initialized;
private static readonly ConditionalWeakTable<object, ObjcTrackingInformation> s_objects = new();
private static delegate* unmanaged<IntPtr, int> s_IsTrackedReferenceCallback;
private static delegate* unmanaged<IntPtr, void> s_OnEnteredFinalizerQueueCallback;
private static delegate* unmanaged<void*, int> s_IsTrackedReferenceCallback;
private static delegate* unmanaged<void*, void> s_OnEnteredFinalizerQueueCallback;

[ThreadStatic]
private static Exception? t_pendingExceptionObject;
Expand Down Expand Up @@ -71,21 +71,21 @@ static bool TryGetTaggedMemory(IntPtr pObj, IntPtr* tagged)
}

[RuntimeExport("ObjectiveCMarshalGetIsTrackedReferenceCallback")]
static delegate* unmanaged<IntPtr, int> GetIsTrackedReferenceCallback()
static delegate* unmanaged<void*, int> GetIsTrackedReferenceCallback()
{
return s_IsTrackedReferenceCallback;
}

[RuntimeExport("ObjectiveCMarshalGetOnEnteredFinalizerQueueCallback")]
static delegate* unmanaged<IntPtr, void> GetOnEnteredFinalizerQueueCallback()
static delegate* unmanaged<void*, void> GetOnEnteredFinalizerQueueCallback()
{
return s_OnEnteredFinalizerQueueCallback;
}

private static bool TryInitializeReferenceTracker(
delegate* unmanaged<void> beginEndCallback,
delegate* unmanaged<IntPtr, int> isReferencedCallback,
delegate* unmanaged<IntPtr, void> trackedObjectEnteredFinalization)
delegate* unmanaged<void*, int> isReferencedCallback,
delegate* unmanaged<void*, void> trackedObjectEnteredFinalization)
{
if (!RuntimeImports.RhRegisterObjectiveCMarshalBeginEndCallback((IntPtr)beginEndCallback))
{
Expand Down

0 comments on commit 7cbf935

Please sign in to comment.