From e16067a9a4929693cf093c43b182bcb49e207cd7 Mon Sep 17 00:00:00 2001 From: Pent Ploompuu Date: Wed, 28 Jul 2021 20:42:37 +0300 Subject: [PATCH] Fix bad inlining in DateTime --- .../System.Private.CoreLib/src/System/DateTime.Windows.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs index d936053f40318..f5de9ed1e9388 100644 --- a/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; @@ -39,6 +40,7 @@ public static unsafe DateTime UtcNow } } + [MethodImpl(MethodImplOptions.NoInlining)] internal static unsafe bool IsValidTimeWithLeapSeconds(int year, int month, int day, int hour, int minute, DateTimeKind kind) { Interop.Kernel32.SYSTEMTIME time; @@ -298,6 +300,7 @@ private static unsafe DateTime UpdateLeapSecondCacheAndReturnUtcNow() return new DateTime(dateData: dotnetDateDataAtStartOfValidityWindow + fileTimeNow - fileTimeAtStartOfValidityWindow); + [MethodImpl(MethodImplOptions.NoInlining)] static DateTime LowGranularityNonCachedFallback() { // If we reached this point, one of the Win32 APIs FileTimeToSystemTime or SystemTimeToFileTime