Skip to content

Commit

Permalink
Add SupportedOSPlatform
Browse files Browse the repository at this point in the history
  • Loading branch information
slozier committed Feb 1, 2025
1 parent 24b802b commit 607d09f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/IronPython.Modules/mmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1401,17 +1401,18 @@ private struct SYSTEM_INFO {
internal short wProcessorRevision;
}

[SupportedOSPlatform("windows")]
[DllImport("kernel32", SetLastError = true)]
private static extern void GetSystemInfo(ref SYSTEM_INFO lpSystemInfo);

private static int GetAllocationGranularity() {
try {
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
return GetAllocationGranularityWorker();
} catch {
return System.Environment.SystemPageSize;
}
return System.Environment.SystemPageSize;
}

[SupportedOSPlatform("windows")]
[MethodImpl(MethodImplOptions.NoInlining)]
private static int GetAllocationGranularityWorker() {
SYSTEM_INFO info = new SYSTEM_INFO();
Expand Down

0 comments on commit 607d09f

Please sign in to comment.