terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
ObjectPool.cs
Go to the documentation of this file.
1using System;
7
8namespace UnityEngine.Pool
9{
10 // Token: 0x02000158 RID: 344
11 public class ObjectPool<T> : IDisposable where T : class
12 {
13 // Token: 0x17000153 RID: 339
14 // (get) Token: 0x0600066F RID: 1647 RVA: 0x000021B3 File Offset: 0x000003B3
15 // (set) Token: 0x06000670 RID: 1648 RVA: 0x0000B6A8 File Offset: 0x000098A8
16 public int CountAll
17 {
19 get
20 {
21 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
22 }
24 private set
25 {
26 }
27 }
28
29 // Token: 0x17000154 RID: 340
30 // (get) Token: 0x06000671 RID: 1649 RVA: 0x0000B6B8 File Offset: 0x000098B8
31 public int CountInactive
32 {
33 get
34 {
35 /*
36An exception occurred when decompiling this method (06000671)
37
38ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 UnityEngine.Pool.ObjectPool`1::get_CountInactive()
39
40 ---> System.Exception: Basic block has to end with unconditional control flow.
41{
42 Block_0:
43 stloc:List`1(var_0_06, ldfld:class [mscorlib]System.Collections.Generic.List`1<!T>[exp:List`1](ObjectPool`1::m_List, ldloc:ObjectPool`1(this)))
44}
45
46 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
47 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
48 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
49 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
50 --- End of inner exception stack trace ---
51 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
52 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
53*/;
54 }
55 }
56
57 // Token: 0x06000672 RID: 1650 RVA: 0x0000B6CC File Offset: 0x000098CC
58 public ObjectPool(Func<T> createFunc, [Optional] Action<T> actionOnGet, [Optional] Action<T> actionOnRelease, [Optional] Action<T> actionOnDestroy, bool collectionCheck = true, int defaultCapacity = 10, int maxSize = 10000)
59 {
60 if (createFunc != null)
61 {
62 this.m_List = this;
64 this.m_MaxSize = maxSize;
68 return;
69 }
70 }
71
72 // Token: 0x06000673 RID: 1651 RVA: 0x0000B710 File Offset: 0x00009910
73 public T Get()
74 {
75 /*
76An exception occurred when decompiling this method (06000673)
77
78ICSharpCode.Decompiler.DecompilerException: Error decompiling T UnityEngine.Pool.ObjectPool`1::Get()
79
80 ---> System.Exception: Basic block has to end with unconditional control flow.
81{
82 IL_001D:
83 stloc:Func`1(var_3_23, ldfld:class [mscorlib]System.Func`1<!T>[exp:Func`1](ObjectPool`1::m_CreateFunc, ldloc:ObjectPool`1(this)))
84 stloc:object(var_4_2A, ldfld:object(List`1::_syncRoot, ldloc:List`1(var_2)))
85 brtrue(IL_0000, logicnot:bool(ldfld:class [mscorlib]System.Action`1<!T>[exp:bool](ObjectPool`1::m_ActionOnGet, ldloc:ObjectPool`1(this))))
86}
87
88 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
89 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
90 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
91 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
92 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
93 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
94 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
95 --- End of inner exception stack trace ---
96 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
97 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
98*/;
99 }
100
101 // Token: 0x06000674 RID: 1652 RVA: 0x0000B750 File Offset: 0x00009950
102 public void Release(T element)
103 {
104 if (this.m_ActionOnRelease != null)
105 {
106 }
107 int maxSize = this.m_MaxSize;
108 List list = this.m_List;
109 }
110
111 // Token: 0x06000675 RID: 1653 RVA: 0x0000B780 File Offset: 0x00009980
112 public void Clear()
113 {
114 if (this.m_ActionOnDestroy != null)
115 {
116 List list = this.m_List;
118 return;
119 }
120 List list2 = this.m_List;
121 }
122
123 // Token: 0x06000676 RID: 1654 RVA: 0x0000B7CC File Offset: 0x000099CC
124 public void Dispose()
125 {
126 }
127
128 // Token: 0x04000638 RID: 1592
130
131 // Token: 0x04000639 RID: 1593
133
134 // Token: 0x0400063A RID: 1594
136
137 // Token: 0x0400063B RID: 1595
139
140 // Token: 0x0400063C RID: 1596
142
143 // Token: 0x0400063D RID: 1597
144 private readonly int m_MaxSize;
145
146 // Token: 0x0400063E RID: 1598
147 internal bool m_CollectionCheck;
148
149 // Token: 0x0400063F RID: 1599
152 private int <CountAll>k__BackingField;
153 }
154}
class f__AnonymousType0<< Count > j__TPar
ObjectPool(Func< T > createFunc, [Optional] Action< T > actionOnGet, [Optional] Action< T > actionOnRelease, [Optional] Action< T > actionOnDestroy, bool collectionCheck=true, int defaultCapacity=10, int maxSize=10000)
Definition ObjectPool.cs:58
readonly Action< T > m_ActionOnDestroy
readonly List< T > m_List
readonly Action< T > m_ActionOnRelease
readonly Func< T > m_CreateFunc
readonly Action< T > m_ActionOnGet
int< CountAll > k__BackingField