EMemoryCriticalLevel 列舉EMemoryCriticalLevel Enumeration

包含值,指出當要求特定記憶體配置但無法滿足時,失敗的影響。Contains values that indicate the impact of a failure when a specific memory allocation has been requested but cannot be satisfied.


typedef enum {  
    eTaskCritical      = 0,  
    eAppDomainCritical = 1,  
    eProcessCritical   = 2  
} EMemoryCriticalLevel;  


成員Member 描述Description
eAppDomainCritical 表示在要求配置的網域中執行 managed 程式碼時,配置是非常重要的。Indicates that the allocation is critical for executing managed code in the domain that has requested the allocation. 如果無法配置記憶體,CLR 就無法保證該網域仍然可用。If memory cannot be allocated, the CLR cannot guarantee that the domain is still usable. 主機會決定無法滿足配置時要採取的動作。The host decides what action to take when the allocation cannot be satisfied. 它可以指示 CLR 自動中止 AppDomain,或藉由在ICLRPolicyManager上呼叫方法,讓它繼續運作。It can instruct the CLR to abort the AppDomain automatically, or allow it to keep running by calling methods on ICLRPolicyManager.
eProcessCritical 表示配置對於進程中的 managed 程式碼執行而言非常重要。Indicates that the allocation is critical to the execution of managed code in the process. 這個值會在啟動期間和執行完成項時使用。This value is used during startup and when running finalizers. 如果無法配置記憶體,CLR 就無法在進程中運作。If memory cannot be allocated, the CLR cannot operate in the process. 如果配置失敗,CLR 會有效地停用。If the allocation fails, the CLR is effectively disabled. 所有對 CLR 的後續呼叫都會失敗,並出現 HOST_E_CLRNOTAVAILABLE。All subsequent calls into the CLR fail with HOST_E_CLRNOTAVAILABLE.
eTaskCritical 指出配置對於執行已要求配置的工作而言非常重要。Indicates that the allocation is critical to running the task that has requested the allocation. 如果無法配置記憶體,CLR 就無法保證可以執行工作。If memory cannot be allocated, the CLR cannot guarantee that the task can be executed. 發生失敗時,CLR 會在實體作業系統執行緒上引發 ThreadAbortExceptionIn the event of failure, the CLR raises a ThreadAbortException on the physical operation system thread.


IHostMemoryManagerIHostMAlloc介面中定義的記憶體配置方法會採用此類型的參數。The memory allocation methods defined in the IHostMemoryManager and IHostMAlloc interfaces take a parameter of this type. 視失敗的嚴重性而定,主機可以決定是否要立即讓配置要求失敗,或等到它可以滿足為止。Depending upon the severity of a failure, a host can decide whether to fail the allocation request immediately or to wait until it can be satisfied.


平台: 請參閱系統需求Platforms: See System Requirements.

標頭: Mscoree.dll. hHeader: MSCorEE.h

連結庫: Mscoree.dll .dllLibrary: MSCorEE.dll

.NET framework 版本: 自 2.0 起可用Available since 2.0.NET Framework Versions: 自 2.0 起可用Available since 2.0

請參閱See also