示例#1
0
        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]);
        }
示例#2
0
        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);
        }