internal FieldDescriptionEntries(MemorySnapshotFileReader reader) { fieldDescriptionName = new ArrayEntries <string>(reader, EntryType.FieldDescriptions_Name, ConversionFunctions.ToString); offset = new ArrayEntries <int>(reader, EntryType.FieldDescriptions_Offset, ConversionFunctions.ToInt32); typeIndex = new ArrayEntries <int>(reader, EntryType.FieldDescriptions_TypeIndex, ConversionFunctions.ToInt32); isStatic = new ArrayEntries <bool>(reader, EntryType.FieldDescriptions_IsStatic, ConversionFunctions.ToBoolean); }
internal ArrayEntries(MemorySnapshotFileReader reader, EntryType entryType, GetItem <T> getItemFunc) { m_Reader = reader; m_EntryType = entryType; m_GetItemFunc = getItemFunc; }
internal NativeRootReferenceEntries(MemorySnapshotFileReader reader) { id = new ArrayEntries <long>(reader, EntryType.NativeRootReferences_Id, ConversionFunctions.ToInt64); areaName = new ArrayEntries <string>(reader, EntryType.NativeRootReferences_AreaName, ConversionFunctions.ToString); objectName = new ArrayEntries <string>(reader, EntryType.NativeRootReferences_ObjectName, ConversionFunctions.ToString); accumulatedSize = new ArrayEntries <ulong>(reader, EntryType.NativeRootReferences_AccumulatedSize, ConversionFunctions.ToUInt64); }
internal NativeMemoryRegionEntries(MemorySnapshotFileReader reader) { memoryRegionName = new ArrayEntries <string>(reader, EntryType.NativeMemoryRegions_Name, ConversionFunctions.ToString); parentIndex = new ArrayEntries <int>(reader, EntryType.NativeMemoryRegions_ParentIndex, ConversionFunctions.ToInt32); addressBase = new ArrayEntries <ulong>(reader, EntryType.NativeMemoryRegions_AddressBase, ConversionFunctions.ToUInt64); addressSize = new ArrayEntries <ulong>(reader, EntryType.NativeMemoryRegions_AddressSize, ConversionFunctions.ToUInt64); firstAllocationIndex = new ArrayEntries <int>(reader, EntryType.NativeMemoryRegions_FirstAllocationIndex, ConversionFunctions.ToInt32); numAllocations = new ArrayEntries <int>(reader, EntryType.NativeMemoryRegions_NumAllocations, ConversionFunctions.ToInt32); }
internal NativeAllocationEntries(MemorySnapshotFileReader reader) { memoryRegionIndex = new ArrayEntries <int>(reader, EntryType.NativeAllocations_MemoryRegionIndex, ConversionFunctions.ToInt32); rootReferenceId = new ArrayEntries <long>(reader, EntryType.NativeAllocations_RootReferenceId, ConversionFunctions.ToInt64); allocationSiteId = new ArrayEntries <long>(reader, EntryType.NativeAllocations_AllocationSiteId, ConversionFunctions.ToInt64); address = new ArrayEntries <ulong>(reader, EntryType.NativeAllocations_Address, ConversionFunctions.ToUInt64); size = new ArrayEntries <ulong>(reader, EntryType.NativeAllocations_Size, ConversionFunctions.ToUInt64); overheadSize = new ArrayEntries <int>(reader, EntryType.NativeAllocations_OverheadSize, ConversionFunctions.ToInt32); paddingSize = new ArrayEntries <int>(reader, EntryType.NativeAllocations_PaddingSize, ConversionFunctions.ToInt32); }
internal NativeObjectEntries(MemorySnapshotFileReader reader) { objectName = new ArrayEntries <string>(reader, EntryType.NativeObjects_Name, ConversionFunctions.ToString); instanceId = new ArrayEntries <int>(reader, EntryType.NativeObjects_InstanceId, ConversionFunctions.ToInt32); size = new ArrayEntries <ulong>(reader, EntryType.NativeObjects_Size, ConversionFunctions.ToUInt64); nativeTypeArrayIndex = new ArrayEntries <int>(reader, EntryType.NativeObjects_NativeTypeArrayIndex, ConversionFunctions.ToInt32); hideFlags = new ArrayEntries <HideFlags>(reader, EntryType.NativeObjects_HideFlags, ConversionFunctions.ToHideFlags); flags = new ArrayEntries <ObjectFlags>(reader, EntryType.NativeObjects_Flags, ConversionFunctions.ToObjectFlags); nativeObjectAddress = new ArrayEntries <ulong>(reader, EntryType.NativeObjects_NativeObjectAddress, ConversionFunctions.ToUInt64); rootReferenceId = new ArrayEntries <long>(reader, EntryType.NativeObjects_RootReferenceId, ConversionFunctions.ToInt64); }
internal TypeDescriptionEntries(MemorySnapshotFileReader reader) { flags = new ArrayEntries <TypeFlags>(reader, EntryType.TypeDescriptions_Flags, ConversionFunctions.ToTypeFlags); typeDescriptionName = new ArrayEntries <string>(reader, EntryType.TypeDescriptions_Name, ConversionFunctions.ToString); assembly = new ArrayEntries <string>(reader, EntryType.TypeDescriptions_Assembly, ConversionFunctions.ToString); fieldIndices = new ArrayEntries <int[]>(reader, EntryType.TypeDescriptions_FieldIndices, ConversionFunctions.ToInt32Array); staticFieldBytes = new ByteArrayEntries(reader, EntryType.TypeDescriptions_StaticFieldBytes); baseOrElementTypeIndex = new ArrayEntries <int>(reader, EntryType.TypeDescriptions_BaseOrElementTypeIndex, ConversionFunctions.ToInt32); size = new ArrayEntries <int>(reader, EntryType.TypeDescriptions_Size, ConversionFunctions.ToInt32); typeInfoAddress = new ArrayEntries <ulong>(reader, EntryType.TypeDescriptions_TypeInfoAddress, ConversionFunctions.ToUInt64); typeIndex = new ArrayEntries <int>(reader, EntryType.TypeDescriptions_TypeIndex, ConversionFunctions.ToInt32); }
protected virtual void Dispose(bool disposing) { if (disposing) { if (m_Reader == null) { return; } m_Reader.Dispose(); m_Reader = null; } }
public static PackedMemorySnapshot Load(string path) { MemorySnapshotFileReader reader = new MemorySnapshotFileReader(path); uint ver = reader.GetDataSingle(EntryType.Metadata_Version, ConversionFunctions.ToUInt32); if (ver < (uint)FormatHistory.SnapshotMinSupportedFormatVersion) { throw new Exception(string.Format("Memory snapshot at {0}, is using an older format version: {1}", new object[] { reader.GetFilePath(), ver.ToString() })); } return(new PackedMemorySnapshot(reader)); }
internal ManagedMemorySectionEntries(MemorySnapshotFileReader reader, EntryType entryTypeBase, bool hasHeapTypeEncodedInAddr) { //all addresses store the heap type in their highest bit (ver 12+) //only the new reader inside com.unity.memoryprofiler will read the encodings GetItem <ulong> func; if (hasHeapTypeEncodedInAddr) { func = ConversionFunctions.ToUInt64WithMask; } else { func = ConversionFunctions.ToUInt64; } startAddress = new ArrayEntries <ulong>(reader, (EntryType)(entryTypeBase + 0), func); bytes = new ByteArrayEntries(reader, (EntryType)(entryTypeBase + 1)); }
internal ManagedMemorySectionEntries(MemorySnapshotFileReader reader, EntryType entryTypeBase) { startAddress = new ArrayEntries <ulong>(reader, (EntryType)(entryTypeBase + 0), ConversionFunctions.ToUInt64); bytes = new ByteArrayEntries(reader, (EntryType)(entryTypeBase + 1)); }
internal PackedMemorySnapshot(MemorySnapshotFileReader reader) { m_Reader = reader; BuildEntries(); }
internal ConnectionEntries(MemorySnapshotFileReader reader) { from = new ArrayEntries <int>(reader, EntryType.Connections_From, ConversionFunctions.ToInt32); to = new ArrayEntries <int>(reader, EntryType.Connections_To, ConversionFunctions.ToInt32); }
internal GCHandleEntries(MemorySnapshotFileReader reader) { target = new ArrayEntries <ulong>(reader, EntryType.GCHandles_Target, ConversionFunctions.ToUInt64); }
internal NativeCallstackSymbolEntries(MemorySnapshotFileReader reader) { symbol = new ArrayEntries <ulong>(reader, EntryType.NativeCallstackSymbol_Symbol, ConversionFunctions.ToUInt64); readableStackTrace = new ArrayEntries <string>(reader, EntryType.NativeCallstackSymbol_ReadableStackTrace, ConversionFunctions.ToString); }
public ByteArrayEntries(MemorySnapshotFileReader reader, EntryType entryType) : base(reader, entryType, null) { }
internal NativeAllocationSiteEntries(MemorySnapshotFileReader reader) { id = new ArrayEntries <long>(reader, EntryType.NativeAllocationSites_Id, ConversionFunctions.ToInt64); memoryLabelIndex = new ArrayEntries <int>(reader, EntryType.NativeAllocationSites_MemoryLabelIndex, ConversionFunctions.ToInt32); callstackSymbols = new ArrayEntries <ulong[]>(reader, EntryType.NativeAllocationSites_CallstackSymbols, ConversionFunctions.ToUInt64Array); }
internal NativeTypeEntries(MemorySnapshotFileReader reader) { typeName = new ArrayEntries <string>(reader, EntryType.NativeTypes_Name, ConversionFunctions.ToString); nativeBaseTypeArrayIndex = new ArrayEntries <int>(reader, EntryType.NativeTypes_NativeBaseTypeArrayIndex, ConversionFunctions.ToInt32); }
internal NativeMemoryLabelEntries(MemorySnapshotFileReader reader) { memoryLabelName = new ArrayEntries <string>(reader, EntryType.NativeMemoryLabels_Name, ConversionFunctions.ToString); }