HeapObject GetOrCreateObject(long address, HeapTypeInformation heapshotTypeInfo = null) { if (!Objects.TryGetValue(address, out var heapObject)) { Objects[address] = heapObject = new HeapObject(address); } if (heapObject.TypeInfo == null && heapshotTypeInfo != null) { heapObject.TypeInfo = heapshotTypeInfo.TypeInfo; heapshotTypeInfo.Objects.Add(heapObject); } return(heapObject); }
public HeapObject AddObject(TypeInformation typeInfo, long address) { string typeName = typeInfo.Name; long typeId = typeInfo.TypeId; if (trackedTypeNames.Remove(typeName)) { TrackedTypes.Add(typeName, typeId); } if (!Types.TryGetValue(typeId, out var heapTypeInfo)) { Types[typeId] = heapTypeInfo = new HeapTypeInformation(typeInfo); } var heapObject = GetOrCreateObject(address, heapTypeInfo); Graph.AddVertex(heapObject); return(heapObject); }
public bool TryGetHeapshotTypeInfo(long typeId, out HeapTypeInformation heapshotTypeInfo) => Types.TryGetValue(typeId, out heapshotTypeInfo);
public bool TryGetHeapshotTypeInfo(string name, out HeapTypeInformation heapshotTypeInfo) { heapshotTypeInfo = null; return(TrackedTypes.TryGetValue(name, out var typeId) && TryGetHeapshotTypeInfo(typeId, out heapshotTypeInfo)); }