DacpHeapSegment 資料結構

定義垃圾回收堆段資訊的傳輸緩衝區。

Note

此 API 原本是針對運行時間內部使用所設計。 雖然現在支援第三方使用,但建議您盡可能使用 ICorDebugICorProfiler API。

Syntax

struct DacpHeapSegmentData
    : ZeroInit<DacpHeapSegmentData>
{
    CLRDATA_ADDRESS segmentAddr;
    CLRDATA_ADDRESS allocated;
    CLRDATA_ADDRESS committed;
    CLRDATA_ADDRESS reserved;
    CLRDATA_ADDRESS used;
    CLRDATA_ADDRESS mem;
    // pass this to request if non-null to get the next segments.
    CLRDATA_ADDRESS next;
    CLRDATA_ADDRESS gc_heap; // only filled in in server mode, otherwise NULL
    // computed field: if this is the ephemeral segment highMark includes the ephemeral generation
    CLRDATA_ADDRESS highAllocMark;

    size_t flags;
    CLRDATA_ADDRESS background_allocated;

    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr, const DacpGcHeapDetails& heap)
    {
        HRESULT hr = sos->GetHeapSegmentData(addr, this);

        // if this is the start segment, set highAllocMark too.
        if (SUCCEEDED(hr))
        {
            // TODO:  This needs to be put on the Dac side.
            if (this->segmentAddr == heap.generation_table[0].start_segment)
                highAllocMark = heap.alloc_allocated;
            else
                highAllocMark = allocated;
        }    
        return hr;
    }
};

Members

會員 說明
segmentAddr 堆積段的位址。
allocated 該路段分配部分的地址。
committed 該區段被提交至的位址。
reserved 該區段保留至最多記憶體的位址。
used 該區段所使用的記憶體位址。
mem 區段記憶體的起始位址。
next 下一個單元的地址。 若非空,則將此值傳給 以 Request 取得下一個區段。
gc_heap GC 堆的位址。 此成員僅在伺服器模式下被填補;否則,為 NULL
highAllocMark 高配額。 若此區段為短暫區段,則此值包含短暫產生。
flags 堆積段標記。
background_allocated 背景GC分配地址給該段。
Request 透過呼叫 ISOSDacInterface::GetHeapSegmentData 並計算 highAllocMark來填充結構。

Remarks

此結構位於運行時間內,不會透過任何標頭或庫檔案公開。 使用時,請依上述定義結構。

要求

平台:請參閱系統需求
標題:
圖書館:
.NET Framework 版本:自 4.7 版本起可用

也請參閱