static AltType GetAltType(AltTypes altTypes, Type type, IntPtr declaration) { if (altTypes.ContainsKey(type)) { return(altTypes[type]); } var altType = new AltType(altTypes, type, declaration); //altTypes[type] = altType; return(altType); }
public static AltType GetAltType(AltTypes altTypes, Type type, object value) { if (altTypes.ContainsKey(type)) { return(altTypes[type]); } var ptr = GetPtr(value); IntPtr declaration = IntPtr.Zero; #if !SAFE_COPY //lock (locker) declaration = Marshal.ReadIntPtr(ptr); #endif AltType altType = new AltType(altTypes, type, declaration); return(altType); }