-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStringInstanceData.cs
61 lines (52 loc) · 1.27 KB
/
StringInstanceData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.Collections.Generic;
namespace UnityHeapDumper
{
public class StringInstanceData : IInstanceData
{
private static readonly IFieldData[] emptyFields = new IFieldData[0];
private int id;
private string str;
private ITypeData typeData;
private int size;
void IInstanceData.Init(IDumpContext dumpContext, object obj, int id)
{
str = (string)obj;
this.id = id;
var typeDataFactory = dumpContext.TypeDataFactory;
typeData = typeDataFactory.Create(typeof(string));
size = str.Length * sizeof(char);
}
int IInstanceData.Id
{
get
{
return id;
}
}
int IInstanceData.GetSize(ICollection<int> seenInstances)
{
return size;
}
ITypeData IInstanceData.TypeData
{
get
{
return typeData;
}
}
IList<IFieldData> IInstanceData.Fields
{
get
{
return emptyFields;
}
}
object IInstanceData.Object
{
get
{
return str;
}
}
}
}