Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InitializeCache()

RuntimeTypeCache System.RuntimeType.InitializeCache ( )
inlineprivate

Definition at line 2108 of file RuntimeType.cs.

2109 {
2110 if (m_cache == IntPtr.Zero)
2111 {
2112 RuntimeTypeHandle runtimeTypeHandle = new RuntimeTypeHandle(this);
2113 IntPtr gCHandle = runtimeTypeHandle.GetGCHandle(GCHandleType.WeakTrackResurrection);
2115 if (intPtr != IntPtr.Zero)
2116 {
2117 runtimeTypeHandle.FreeGCHandle(gCHandle);
2118 }
2119 }
2120 RuntimeTypeCache runtimeTypeCache = (RuntimeTypeCache)GCHandle.InternalGet(m_cache);
2121 if (runtimeTypeCache == null)
2122 {
2123 runtimeTypeCache = new RuntimeTypeCache(this);
2124 RuntimeTypeCache runtimeTypeCache2 = (RuntimeTypeCache)GCHandle.InternalCompareExchange(m_cache, runtimeTypeCache, null);
2125 if (runtimeTypeCache2 != null)
2126 {
2128 }
2129 }
2130 return runtimeTypeCache;
2131 }
static int CompareExchange(ref int location1, int value, int comparand)
static unsafe object InternalGet(IntPtr handle)
Definition GCHandle.cs:40
static object InternalCompareExchange(IntPtr handle, object value, object oldValue)

References System.Threading.Interlocked.CompareExchange(), System.Runtime.InteropServices.GCHandle.InternalCompareExchange(), System.Runtime.InteropServices.GCHandle.InternalGet(), System.RuntimeType.m_cache, and System.IntPtr.Zero.