Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad inlining in DateTime #56466

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down