Example #1
0
        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);
        }
Example #2
0
        public void AddReference(HeapObject source, long target, string viaField = null)
        {
            var referencedObject = GetOrCreateObject(target, null);

            Graph.AddEdge(new Edge <HeapObject>(source, referencedObject));
        }