Redaguoti

DacpHeapSegmentData Structure

Defines a transport buffer for garbage collection heap segment information.

Note

This API was originally designed for internal use in the runtime. Although it is now supported for 3rd party use, we recommend working with ICorDebug and ICorProfiler APIs when possible.

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

Member Description
segmentAddr The address of the heap segment.
allocated The address of the allocated portion of the segment.
committed The address up to which memory is committed for the segment.
reserved The address up to which memory is reserved for the segment.
used The address up to which memory is used for the segment.
mem The start address of the segment memory.
next The address of the next segment. Pass this value to Request if it is non-null to retrieve the next segment.
gc_heap The address of the GC heap. This member is filled only in server mode; otherwise, it is NULL.
highAllocMark The high allocation mark. If this segment is the ephemeral segment, this value includes the ephemeral generation.
flags The heap segment flags.
background_allocated The background GC allocated address for the segment.
Request Populates the structure by calling ISOSDacInterface::GetHeapSegmentData and computes highAllocMark.

Remarks

This structure lives inside the runtime and is not exposed through any headers or library files. To use it, define the structure as specified above.

Requirements

Platforms: See System Requirements.
Header: None
Library: None
.NET Framework Versions: Available since 4.7

See also