源战役客户端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
672 B

using System;
using UnityEditor.MemoryProfiler;
namespace MemoryProfilerWindow
{
static class ManagedHeapExtensions
{
public static BytesAndOffset Find(this MemorySection[] heap, UInt64 address, VirtualMachineInformation virtualMachineInformation)
{
foreach (var segment in heap)
if (address >= segment.startAddress && address < (segment.startAddress + (ulong)segment.bytes.Length))
return new BytesAndOffset() { bytes = segment.bytes, offset = (int)(address - segment.startAddress), pointerSize = virtualMachineInformation.pointerSize };
return new BytesAndOffset();
}
}
}