Skip to content

Commit

Permalink
Delete the RequiresPreviewFeaturesAttribute from RefreshMemoryLimit (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored Sep 5, 2023
1 parent 4c0a7c4 commit 4b9132f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -899,13 +899,10 @@ internal enum RefreshMemoryStatus
///
/// This API will only handle configs that could be handled when the runtime is loaded, for example, for configs that don't have any effects on 32-bit systems (like the GCHeapHardLimit* ones), this API will not handle it.
///
/// As of now, this API is feature preview only and subject to changes as necessary.
///
/// <exception cref="InvalidOperationException">If the hard limit is too low. This can happen if the heap hard limit that the refresh will set, either because of new AppData settings or implied by the container memory limit changes, is lower than what is already committed.</exception>
/// <exception cref="InvalidOperationException">If the hard limit is invalid. This can happen, for example, with negative heap hard limit percentages.</exception>
///
/// </summary>
[RequiresPreviewFeatures("RefreshMemoryLimit is in preview.")]
public static void RefreshMemoryLimit()
{
ulong heapHardLimit = (AppContext.GetData("GCHeapHardLimit") as ulong?) ?? ulong.MaxValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ public static TimeSpan GetTotalPauseDuration()
return new TimeSpan(RuntimeImports.RhGetTotalPauseDuration());
}

[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("RefreshMemoryLimit is in preview.")]
public static void RefreshMemoryLimit()
{
ulong heapHardLimit = (AppContext.GetData("GCHeapHardLimit") as ulong?) ?? ulong.MaxValue;
Expand Down
1 change: 0 additions & 1 deletion src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2722,7 +2722,6 @@ public static void SuppressFinalize(object obj) { }
public static void WaitForPendingFinalizers() { }
public static TimeSpan GetTotalPauseDuration() { throw null; }
public static System.Collections.Generic.IReadOnlyDictionary<string, object> GetConfigurationVariables() { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("RefreshMemoryLimit is in preview.")]
public static void RefreshMemoryLimit() { throw null; }
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
</Suppressions>
<Suppression>
<DiagnosticId>CP0014</DiagnosticId>
<Target>M:System.GC.RefreshMemoryLimit:[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]</Target>
<Left>net8.0/mscorlib.dll</Left>
<Right>net9.0/mscorlib.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0014</DiagnosticId>
<Target>M:System.GC.RefreshMemoryLimit:[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]</Target>
<Left>net8.0/netstandard.dll</Left>
<Right>net9.0/netstandard.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0014</DiagnosticId>
<Target>M:System.GC.RefreshMemoryLimit:[T:System.Runtime.Versioning.RequiresPreviewFeaturesAttribute]</Target>
<Left>net8.0/System.Runtime.dll</Left>
<Right>net9.0/System.Runtime.dll</Right>
</Suppression>
</Suppressions>
1 change: 0 additions & 1 deletion src/mono/System.Private.CoreLib/src/System/GC.Mono.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ public static System.Collections.Generic.IReadOnlyDictionary<string, object> Get
return new System.Collections.Generic.Dictionary<string, object>();
}

[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("RefreshMemoryLimit is in preview.")]
public static void RefreshMemoryLimit()
{
throw new PlatformNotSupportedException();
Expand Down

0 comments on commit 4b9132f

Please sign in to comment.