Compartilhar via


ICorProfilerInfo2::GetObjectGeneration Method

Gets the segment of the heap that contains the specified object.

HRESULT GetObjectGeneration(
    [in] ObjectID objectId,
    [out] COR_PRF_GC_GENERATION_RANGE *range);

Parameters

  • objectId
    [in] The ID of the object.

  • range
    [out] A pointer to a COR_PRF_GC_GENERATION_RANGE structure, which describes a range (that is, a block) of memory within the generation that is undergoing garbage collection. This range contains the specified object.

Remarks

The GetObjectGeneration method may be called from any profiler callback, provided that garbage collection is not in progress. That is, it may be called from any callback except those that occur between ICorProfilerCallback2::GarbageCollectionStarted and ICorProfilerCallback2::GarbageCollectionFinished.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Concepts

ICorProfilerInfo Interface

ICorProfilerInfo2 Interface