Skip to content

Commit

Permalink
Moving InsufficientMemoryException and OutOfMemoryException to shared…
Browse files Browse the repository at this point in the history
…/System

Related to: dotnet/coreclr#17904
  • Loading branch information
maryamariyan committed May 18, 2018
1 parent f02f59f commit 10b09a4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/System.Private.CoreLib/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@
<data name="Arg_OverflowException" xml:space="preserve">
<value>Arithmetic operation resulted in an overflow.</value>
</data>
<data name="Arg_OutOfMemoryException" xml:space="preserve">
<value>Insufficient memory to continue the execution of the program.</value>
</data>
<data name="Arg_ParamName_Name" xml:space="preserve">
<value>Parameter name: {0}</value>
</data>
Expand Down
2 changes: 0 additions & 2 deletions src/System.Private.CoreLib/System.Private.CoreLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@
<Compile Include="$(BclSourcesRoot)\System\Text\StringBuilder.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Exception.cs" />
<Compile Include="$(BclSourcesRoot)\System\DateTime.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\OutOfMemoryException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Delegate.cs" />
<Compile Include="$(BclSourcesRoot)\System\MulticastDelegate.cs" />
<Compile Include="$(BclSourcesRoot)\System\Activator.cs" />
Expand All @@ -338,7 +337,6 @@
<Compile Include="$(BclSourcesRoot)\System\Enum.cs" />
<Compile Include="$(BclSourcesRoot)\System\Environment.cs" />
<Compile Include="$(BclSourcesRoot)\System\GC.cs" />
<Compile Include="$(BclSourcesRoot)\System\InsufficientMemoryException.cs" />
<Compile Include="$(BclSourcesRoot)\System\Internal.cs" />
<Compile Include="$(BclSourcesRoot)\System\Math.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\MathF.CoreCLR.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\IFormattable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IndexOutOfRangeException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InsufficientExecutionStackException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InsufficientMemoryException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InvalidCastException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InvalidOperationException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InvalidProgramException.cs" />
Expand Down Expand Up @@ -273,6 +274,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\ObjectDisposedException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ObsoleteAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\OperationCanceledException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\OutOfMemoryException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\OverflowException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ParamArrayAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ParamsArray.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
**
=============================================================================*/


using System;
using System.Runtime.Serialization;

Expand All @@ -26,8 +25,10 @@ namespace System
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public sealed class InsufficientMemoryException : OutOfMemoryException
{
// There may be a problem here interacting with the ResourceManager in out of memory conditions,
// CoreCLR can fall back to literal strings.
public InsufficientMemoryException()
: base(GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory))
: base(SR.Arg_OutOfMemoryException)
{
HResult = HResults.COR_E_INSUFFICIENTMEMORY;
}
Expand All @@ -46,6 +47,6 @@ public InsufficientMemoryException(String message, Exception innerException)

private InsufficientMemoryException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
**
=============================================================================*/


using System;
using System.Runtime.Serialization;

namespace System
Expand All @@ -22,7 +20,7 @@ namespace System
public class OutOfMemoryException : SystemException
{
public OutOfMemoryException()
: base(GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory))
: base(SR.Arg_OutOfMemoryException)
{
HResult = HResults.COR_E_OUTOFMEMORY;
}
Expand Down

0 comments on commit 10b09a4

Please sign in to comment.