COR_GC_REFERENCE 結構COR_GC_REFERENCE Structure

包含要進行記憶體回收之物件的相關資訊。Contains information about an object that is to be garbage-collected.

語法Syntax

typedef struct _COR_GC_REFERENCE {  
    ICorDebugAppDomain *domain;
    ICorDebugValue *location;  
    CorGCReferenceType type;  
    UINT64 extraData;  
} COR_GC_REFERENCE;  

成員Members

memberMember 描述Description
domain 控制碼或物件所屬應用程式域的指標。A pointer to the application domain to which the handle or object belongs. 其值可能為 nullIts value may be null.
location 對應至要進行垃圾收集之物件的 ICorDebugValue 或 ICorDebugReferenceValue 介面。Either an ICorDebugValue or an ICorDebugReferenceValue interface that corresponds to the object to be garbage-collected.
type 指出根目錄來源的 CorGCReferenceType 列舉值。A CorGCReferenceType enumeration value that indicates where the root came from. 如需詳細資訊,請參閱<備註>一節。For more information, see the Remarks section.
extraData 要進行垃圾收集之物件的其他相關資料。Additional data about the object to be garbage-collected. 此資訊取決於物件的來源,如欄位所示 typeThis information depends on the source of the object, as indicated by the type field. 如需詳細資訊,請參閱<備註>一節。For more information, see the Remarks section.

備註Remarks

type 欄位是 CorGCReferenceType 列舉值,指出參考的來源位置。The type field is a CorGCReferenceType enumeration value that indicates where the reference came from. 特定 COR_GC_REFERENCE 值可反映下列任何一種 managed 物件:A particular COR_GC_REFERENCE value can reflect any of the following kinds of managed objects:

  • 所有 managed 堆疊中的物件 (CorGCReferenceType.CorReferenceStack) 。Objects from all managed stacks (CorGCReferenceType.CorReferenceStack). 這包括 managed 程式碼中的即時參考,以及 common language runtime 所建立的物件。This includes live references in managed code, as well as objects created by the common language runtime.

  • 控制碼資料表中的物件 (CorGCReferenceType.CorHandle*) 。Objects from the handle table (CorGCReferenceType.CorHandle*). 這包括 (中的強式參考 HNDTYPE_STRONG ,以及 HNDTYPE_REFCOUNT 模組中的) 和靜態變數。This includes strong references (HNDTYPE_STRONG and HNDTYPE_REFCOUNT) and static variables in a module.

  • 完成項佇列中的物件 (CorGCReferenceType.CorReferenceFinalizer) 。Objects from the finalizer queue (CorGCReferenceType.CorReferenceFinalizer). 完成項會將根物件排在佇列中,直到完成項執行為止。The finalizer queue roots objects until the finalizer has run.

extraData 欄位包含額外的資料,這取決於參考的來源 (或類型) 。The extraData field contains extra data depending on the source (or type) of the reference. 可能的值包括:Possible values are:

  • DependentSource.DependentSource. 如果 typeCorGCREferenceType.CorHandleStrongDependent ,這個欄位就是物件,如果是「作用中」,則為要在其中進行垃圾收集的物件 COR_GC_REFERENCE.LocationIf the type is CorGCREferenceType.CorHandleStrongDependent, this field is the object that, if alive, roots the object to be garbage-collected at COR_GC_REFERENCE.Location.

  • RefCount.RefCount. 如果 typeCorGCREferenceType.CorHandleStrongRefCount ,則此欄位為控制碼的參考計數。If the type is CorGCREferenceType.CorHandleStrongRefCount, this field is the reference count of the handle.

  • Size.Size. 如果 typeCorGCREferenceType.CorHandleStrongSizedByref ,則此欄位為垃圾收集行程計算物件根之物件樹狀結構的最後大小。If the type is CorGCREferenceType.CorHandleStrongSizedByref, this field is the last size of the object tree for which the garbage collector calculated the object roots. 請注意,這項計算不一定是最新的。Note that this calculation is not necessarily up to date.

規格需求Requirements

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

標頭: CorDebug.idl、CorDebug.hHeader: CorDebug.idl, CorDebug.h

程式庫: CorGuids.libLibrary: CorGuids.lib

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

另請參閱See also