Delen 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: See .NET Framework System Requirements.

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Versions: 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

See Also

Reference

ICorProfilerInfo Interface

ICorProfilerInfo2 Interface