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

Parameter Description

objectId

[in] The ID of the object.

range

[out] A pointer to a COR_PRF_GC_GENERATION_RANGE Structure 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 Method and ICorProfilerCallback2::GarbageCollectionFinished Method.

Requirements

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

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Reference

ICorProfilerInfo Interface
ICorProfilerInfo2 Interface