{
// Given an ObjectID, fetches all its object references and offsets (if any).
HRESULT GetObjectReferences(ObjectID objectId, ULONG32 cNumReferences, ULONG32 *pcNumReferences, ObjectID references[], SIZE_T offsets[]);
+
+ // Given an ObjectID, determines whether it is in a read only segment.
+ HRESULT IsFrozenObject(ObjectID objectId, BOOL *pbFrozen);
}
/*
ObjectID references[ ],
SIZE_T offsets[ ]) = 0;
+ virtual HRESULT STDMETHODCALLTYPE IsFrozenObject(
+ ObjectID objectId,
+ BOOL *pbFrozen) = 0;
+
};
ObjectID references[ ],
SIZE_T offsets[ ]);
+ HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )(
+ ICorProfilerInfo10 * This,
+ ObjectID objectId,
+ BOOL *pbFrozen);
+
END_INTERFACE
} ICorProfilerInfo10Vtbl;
#define ICorProfilerInfo10_GetObjectReferences(This,objectId,cNumReferences,pcNumReferences,references,offsets) \
( (This)->lpVtbl -> GetObjectReferences(This,objectId,cNumReferences,pcNumReferences,references,offsets) )
+#define ICorProfilerInfo10_IsFrozenObject(This,objectId,pbFrozen) \
+ ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) )
+
#endif /* COBJMACROS */
}
/*
+ * IsFrozenObject
+ *
+ * Determines whether the object is in a read-only segment
+ *
+ * Parameters:
+ * objectId - object id of interest
+ *
+ * Returns:
+ * S_OK if successful
+ *
+ */
+HRESULT ProfToEEInterfaceImpl::IsFrozenObject(ObjectID objectId, BOOL *pbFrozen)
+{
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ EE_THREAD_NOT_REQUIRED;
+ CANNOT_TAKE_LOCK;
+ }
+ CONTRACTL_END;
+
+ PROFILER_TO_CLR_ENTRYPOINT_SYNC_EX(
+ kP2EEAllowableAfterAttach,
+ (LF_CORPROF,
+ LL_INFO1000,
+ "**PROF: IsFrozenObject 0x%p.\n",
+ objectId));
+
+ *pbFrozen = GCHeapUtilities::GetGCHeap()->IsInFrozenSegment((Object*)objectId) ? TRUE : FALSE;
+
+ return S_OK;
+}
+
+/*
* GetStringLayout
*
* This function describes to a profiler the internal layout of a string.
ObjectID references[],
SIZE_T offsets[]);
+ COM_METHOD IsFrozenObject(ObjectID objectId, BOOL *pbFrozen);
+
// end ICorProfilerInfo10
protected: