home *** CD-ROM | disk | FTP | other *** search
- // gcinfo.hpp
- //
- // Created 07/29/99
- //
- // (C)Copyright 1999 Microsoft Corporation, All rights reserved.
- //
-
- #ifndef __GCINFO_HPP__
- #define __GCINFO_HPP__
-
- #include "hpmnclnt.hpp"
-
-
- struct PerGCInformation
- {
- // GC number
- ULONG iGC;
-
- // which parts of this struct are filled in
- DWORD InfoMaskCollected;
-
- // Valid if (InfoMaskCollected & HMC_INFO_HEAP_OBJECTS)
-
- // number of objects
- ULONG nObjects;
- // total bytes of live objects
- size_t cbObjects;
-
- // Valid if (InfoMaskCollected & (HMC_INFO_HEAP_OBJECTS | HMC_INFO_HEAP_OBJECT_REFS))
- // == (HMC_INFO_HEAP_OBJECTS | HMC_INFO_HEAP_OBJECT_REFS)
-
- // number of edges from objects
- ULONG nObjectEdges;
- // number of objects with multiple references
- ULONG nObjectsWithMultipleReferences;
-
- // Valid if (InfoMaskCollected & HMC_INFO_HEAP_ROOTS)
-
- // per-root counts
- ULONG rgcRoots[C_LAST - C_FIRST - 1];
-
- // Valid if (InfoMaskCollected & HMC_INFO_HEAP_ROOT_REFS)
-
- // number of edges from roots
- ULONG nRootEdges;
- // per-root reference counts
- ULONG rgcRootReferences[C_LAST - C_FIRST - 1];
-
- // Valid if (InfoMaskCollected & HMC_INFO_COUNT_MONITORS)
-
- // number of active object monitors
- __int64 nObjectMonitors;
-
- PerGCInformation *prev;
- PerGCInformation *next;
-
-
- ULONG GetTotalNumObjects ()
- {
- ASSERT(InfoMaskCollected & HMC_INFO_HEAP_OBJECTS);
- return nObjects;
- }
-
- size_t GetTotalSizeOfObjects ()
- {
- ASSERT(InfoMaskCollected & HMC_INFO_HEAP_OBJECTS);
- return cbObjects;
- }
-
- ULONG GetNumObjectEdges ()
- {
- ASSERT((InfoMaskCollected & (HMC_INFO_HEAP_OBJECTS | HMC_INFO_HEAP_OBJECT_REFS))
- == (HMC_INFO_HEAP_OBJECTS | HMC_INFO_HEAP_OBJECT_REFS));
- return nObjectEdges;
- }
-
- ULONG GetNumMultiRefObjects ()
- {
- ASSERT((InfoMaskCollected & (HMC_INFO_HEAP_OBJECTS | HMC_INFO_HEAP_OBJECT_REFS))
- == (HMC_INFO_HEAP_OBJECTS | HMC_INFO_HEAP_OBJECT_REFS));
- return nObjectsWithMultipleReferences;
- }
-
- ULONG GetNumRootEdges ()
- {
- ASSERT(InfoMaskCollected & HMC_INFO_HEAP_ROOT_REFS);
- return nRootEdges;
- }
-
- ULONG GetRootCountByType (CONTAINER_TYPE type)
- {
- ASSERT(InfoMaskCollected & HMC_INFO_HEAP_ROOTS);
- return rgcRoots[type - C_FIRST - 1];
- }
-
- ULONG GetNumReferencesFromRootType (CONTAINER_TYPE type)
- {
- ASSERT(InfoMaskCollected & HMC_INFO_HEAP_ROOT_REFS);
- return rgcRootReferences[type - C_FIRST - 1];
- }
-
- __int64 GetNumObjectMonitors ()
- {
- ASSERT(InfoMaskCollected & HMC_INFO_COUNT_MONITORS);
- return nObjectMonitors;
- }
- };
-
-
- #endif /* __GCINFO_HPP__ */
-
-