Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Change native side instead
  • Loading branch information
MichalStrehovsky authored and github-actions committed Jan 6, 2025
commit fe399fba0663e85f2ddf0cd0f6711ee5c97a56c1
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/Runtime/RestrictedCallouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ class RestrictedCallouts
static CrstStatic s_sLock;

// Prototypes for the callouts.
typedef void (F_CALL_CONV * GcRestrictedCallbackFunction)(uint32_t uiCondemnedGeneration);
typedef void (* GcRestrictedCallbackFunction)(uint32_t uiCondemnedGeneration);
typedef CLR_BOOL (* HandleTableRestrictedCallbackFunction)(Object * pObject);
};
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ public static void EndReferenceTracking()

public static unsafe void RegisterGCCallbacks()
{
delegate* unmanaged[Fastcall]<int, void> gcStartCallback = &GCStartCollection;
delegate* unmanaged[Fastcall]<int, void> gcStopCallback = &GCStopCollection;
delegate* unmanaged[Fastcall]<int, void> gcAfterMarkCallback = &GCAfterMarkPhase;
delegate* unmanaged<int, void> gcStartCallback = &GCStartCollection;
delegate* unmanaged<int, void> gcStopCallback = &GCStopCollection;
delegate* unmanaged<int, void> gcAfterMarkCallback = &GCAfterMarkPhase;

if (!RuntimeImports.RhRegisterGcCallout(RuntimeImports.GcRestrictedCalloutKind.StartCollection, (IntPtr)gcStartCallback) ||
!RuntimeImports.RhRegisterGcCallout(RuntimeImports.GcRestrictedCalloutKind.EndCollection, (IntPtr)gcStopCallback) ||
Expand All @@ -155,7 +155,7 @@ public static bool AddReferencePath(object target, object foundReference)
}

// Used during GC callback
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvFastcall)])]
[UnmanagedCallersOnly]
private static void GCStartCollection(int condemnedGeneration)
{
if (condemnedGeneration >= 2)
Expand All @@ -167,7 +167,7 @@ private static void GCStartCollection(int condemnedGeneration)
}

// Used during GC callback
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvFastcall)])]
[UnmanagedCallersOnly]
private static void GCStopCollection(int condemnedGeneration)
{
if (condemnedGeneration >= 2)
Expand All @@ -177,7 +177,7 @@ private static void GCStopCollection(int condemnedGeneration)
}

// Used during GC callback
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvFastcall)])]
[UnmanagedCallersOnly]
private static void GCAfterMarkPhase(int condemnedGeneration)
{
DetachNonPromotedObjects();
Expand Down
Loading