in src/Microsoft.Diagnostics.Runtime/DacImplementation/DacNativeHeaps.cs [140:167]
public IEnumerable<ClrNativeHeapInfo> EnumerateDomainHeaps(ulong domain)
{
if (domain == 0)
yield break;
ulong loaderAllocator;
if (_sos13 is not null
&& (loaderAllocator = _sos13.GetDomainLoaderAllocator(domain)) != 0
&& GetNativeHeaps().Length > 0)
{
foreach (ClrNativeHeapInfo heap in EnumerateLoaderAllocatorNativeHeaps(loaderAllocator))
yield return heap;
}
else if (_sos.GetAppDomainData(domain, out AppDomainData data))
{
foreach (ClrNativeHeapInfo heapInfo in LegacyEnumerateLoaderAllocatorHeaps(data.StubHeap, LoaderHeapKind.LoaderHeapKindNormal, NativeHeapKind.StubHeap))
yield return heapInfo;
foreach (ClrNativeHeapInfo heapInfo in LegacyEnumerateLoaderAllocatorHeaps(data.HighFrequencyHeap, LoaderHeapKind.LoaderHeapKindNormal, NativeHeapKind.HighFrequencyHeap))
yield return heapInfo;
foreach (ClrNativeHeapInfo heapInfo in LegacyEnumerateLoaderAllocatorHeaps(data.LowFrequencyHeap, LoaderHeapKind.LoaderHeapKindNormal, NativeHeapKind.LowFrequencyHeap))
yield return heapInfo;
foreach (ClrNativeHeapInfo heapInfo in LegacyEnumerateStubHeaps(domain))
yield return heapInfo;
}
}