定义用于垃圾回收堆段信息的传输缓冲区。
Note
此 API 最初旨在供运行时内部使用。 尽管现在支持第三方使用,但我们建议尽量使用 ICorDebug 和 ICorProfiler 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 为非 null,则将其传递给检索下一段。 |
gc_heap |
GC 堆的地址。 此成员仅在服务器模式下填充;否则,为 NULL. |
highAllocMark |
高分配标记。 如果此段是临时段,则此值包括临时生成。 |
flags |
堆段标志。 |
background_allocated |
为段分配的后台 GC 地址。 |
Request |
通过调用 ISOSDacInterface::GetHeapSegmentData 和计算 highAllocMark填充结构。 |
Remarks
此结构位于运行时内,不会通过任何标头或库文件公开。 若要使用它,请定义上面指定的结构。
要求
平台:请参阅系统要求。
页眉: 没有
图书馆: 没有
.NET Framework 版本:自 4.7 起可用