home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / FL_gchost_idl________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Text File  |  2001-07-24  |  4.4 KB  |  117 lines

  1. // ==++==
  2. // 
  3. //   Copyright (c) Microsoft Corporation.  All rights reserved.
  4. // 
  5. // ==--==
  6. /* -------------------------------------------------------------------------- *
  7.  * Common Language Runtime Profiling interfaces
  8.  *
  9.  * The IGCHost allows a host environment to get statistics about the
  10.  * garbage collector as well as to gain some limited control over collections.
  11.  * This interface can be QueryInterface'd for on from the CorHost object.
  12.  * -------------------------------------------------------------------------- */
  13.  
  14. import "unknwn.idl";
  15.  
  16. cpp_quote("#ifndef _BASETSD_H_")
  17. #include "basetsd.h"
  18. cpp_quote("#endif // _BASETSD_H_")
  19.  
  20.  
  21. typedef enum
  22. {
  23.     COR_GC_COUNTS                 = 0x00000001,         // Fill out count values.
  24.     COR_GC_MEMORYUSAGE            = 0x00000002,         // Fill out memory usage values.
  25. } COR_GC_STAT_TYPES;
  26.  
  27. typedef enum
  28. {
  29.     COR_GC_THREAD_HAS_PROMOTED_BYTES  = 0x00000001      // Thread has bytes promoted in the last GC
  30.                                                         // if flags set to this value.
  31. } COR_GC_THREAD_STATS_TYPES;
  32.  
  33.  
  34. /*
  35.  * This structure is used to return statics for the GC system.  Set the Flags
  36.  * value to a bitmask of values that should be returned.  Only those values which
  37.  * are requested are calculated and returned to the caller.
  38.  */
  39. typedef struct _COR_GC_STATS
  40. {
  41.     ULONG       Flags;                                  // What values to get.
  42.  
  43.     // Value when COR_GC_COUNTS is specified.
  44.     SIZE_T       ExplicitGCCount;                        // How many times was GC forced to run by external request.
  45.     SIZE_T       GenCollectionsTaken[3];                    // Number of collections done for each generation
  46.  
  47.     // Memory sizes, valid for COR_GC_MEMORYUSAGE.
  48.     SIZE_T       CommittedKBytes;                        // Total committed bytes from all heaps.    
  49.     SIZE_T       ReservedKBytes;                         // Total reserved bytes from all heaps.    
  50.     SIZE_T       Gen0HeapSizeKBytes;                     // Size of gen 0 heap.
  51.     SIZE_T       Gen1HeapSizeKBytes;                     // Size of gen 1 heap.
  52.     SIZE_T       Gen2HeapSizeKBytes;                     // Size of gen 2 heap.
  53.     SIZE_T       LargeObjectHeapSizeKBytes;              // Size of large object heap.
  54.     SIZE_T       KBytesPromotedFromGen0;                 // How many bytes promoted to next generation.
  55.     SIZE_T       KBytesPromotedFromGen1;
  56.  
  57. } COR_GC_STATS;
  58.  
  59. /*
  60.  * This structure is used to return per-thread statistics related to GC.
  61.  */
  62. typedef struct _COR_GC_THREAD_STATS
  63. {
  64.     ULONGLONG   PerThreadAllocation;                    // Amount of memory allocated on this
  65.                                                         // thread.  Cleared to 0 on each Gen 0 collection.
  66.     ULONG       Flags;                                  // Thread has bytes promoted in the last GC?
  67. } COR_GC_THREAD_STATS;
  68.  
  69.  
  70.  
  71. /*
  72.  * This interface is used to get information about the GC system and
  73.  * control some aspects of the GC.  This interface is for expert usage
  74.  * only, and can severely impact the performance of an application if
  75.  * used improperly!!
  76.  */
  77. [
  78.     object,
  79.     uuid(FAC34F6E-0DCD-47b5-8021-531BC5ECCA63),
  80.     pointer_default(unique),
  81.     local
  82. ]
  83. interface IGCHost : IUnknown
  84. {
  85.     /*
  86.      * Sets the segment size and gen 0 maximum size.  This value may only be
  87.      * specified once and will not change if called later.
  88.      */
  89.     HRESULT SetGCStartupLimits([in] DWORD SegmentSize, [in] DWORD MaxGen0Size);
  90.     
  91.     /*
  92.      * Forces a collection to occur for the given generation, regardless of
  93.      * current GC statistics.  A value of -1 means collect all generations.
  94.      */
  95.     HRESULT Collect([in] long Generation);
  96.     
  97.     /*
  98.      * Returns a set of current statistics about the state of the GC system.
  99.      * These values can then be used by a smart allocation system to help the
  100.      * GC run, by say adding more memory or forcing a collection.
  101.      */
  102.     HRESULT GetStats([in][out] COR_GC_STATS *pStats);
  103.     
  104.     /*
  105.      * This method returns the per-thread statics gathered by the GC. 
  106.      */
  107.     HRESULT GetThreadStats([in] DWORD *pFiberCookie, [in][out] COR_GC_THREAD_STATS *pStats);
  108.     
  109.     /*
  110.      * This method allows the caller to set virtual memory limit (MB) of the runtime. This limit
  111.      * can be changed dynamically.
  112.      */
  113.     HRESULT SetVirtualMemLimit ([in] SIZE_T sztMaxVirtualMemMB);
  114. }
  115.  
  116.  
  117.