Skip to content

Commit 607d09f

Browse files
committed
Add SupportedOSPlatform
1 parent 24b802b commit 607d09f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/core/IronPython.Modules/mmap.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,17 +1401,18 @@ private struct SYSTEM_INFO {
14011401
internal short wProcessorRevision;
14021402
}
14031403

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

14071408
private static int GetAllocationGranularity() {
1408-
try {
1409+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
14091410
return GetAllocationGranularityWorker();
1410-
} catch {
1411-
return System.Environment.SystemPageSize;
14121411
}
1412+
return System.Environment.SystemPageSize;
14131413
}
14141414

1415+
[SupportedOSPlatform("windows")]
14151416
[MethodImpl(MethodImplOptions.NoInlining)]
14161417
private static int GetAllocationGranularityWorker() {
14171418
SYSTEM_INFO info = new SYSTEM_INFO();

0 commit comments

Comments
 (0)