Refactoring the ARM Hardware Intrinsics based on the latest design decisions. (#26895)
[mono-project.git] / netcore / System.Private.CoreLib / shared / System / InsufficientMemoryException.cs
blob900f626a02c1041329b00621769b51108042ff22
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System.Runtime.Serialization;
7 namespace System
9 /// <summary>
10 /// Purpose: The exception class for running out of memory
11 /// but most likely in a non-fatal way that shouldn't
12 /// be affected by escalation policy. Use this for cases
13 /// like MemoryFailPoint or a TryAllocate method, where you
14 /// expect OOM's with no shared state corruption and you
15 /// want to recover from these errors.
16 /// </summary>
17 [Serializable]
18 [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
19 public sealed class InsufficientMemoryException : OutOfMemoryException
21 public InsufficientMemoryException() : base(
22 #if CORECLR
23 GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory)
24 #else
25 SR.Arg_OutOfMemoryException
26 #endif
29 HResult = HResults.COR_E_INSUFFICIENTMEMORY;
32 public InsufficientMemoryException(string? message)
33 : base(message)
35 HResult = HResults.COR_E_INSUFFICIENTMEMORY;
38 public InsufficientMemoryException(string? message, Exception? innerException)
39 : base(message, innerException)
41 HResult = HResults.COR_E_INSUFFICIENTMEMORY;
44 private InsufficientMemoryException(SerializationInfo info, StreamingContext context) : base(info, context)