protected TDyn wire(MethodInfo mi, IntPtr ptr, CallingConvention conv) { if (!Cache) { return(wireNoCache(mi, ptr, conv)); } var key = new PAddrCache <TDyn> .Key(ptr, conv); if (!xTDyn.ContainsKey(key)) { xTDyn[key] = wireNoCache(mi, ptr, conv); } return(xTDyn[key]); }
protected T getDelegate <T>(IntPtr ptr, CallingConvention conv) where T : class { if (!Cache) { return(getDelegateNoCache <T>(ptr, conv) as T); } var key = new PAddrCache <Delegate> .Key(ptr, conv); if (!xDelegates.ContainsKey(key)) { xDelegates[key] = getDelegateNoCache <T>(ptr, conv); } return(xDelegates[key] as T); }