internal static ThunkInfo GetThunk(MethodInfo method, string funcType = null) { Type dt; if (funcType != null) { dt = typeof(Interop).GetNestedType(funcType) as Type; } else { dt = GetPrototype(method.Name); } if (dt == null) { return(ThunkInfo.Empty); } Delegate d = Delegate.CreateDelegate(dt, method); var info = new ThunkInfo(d); return(info); }
internal static ThunkInfo GetThunk(MethodInfo method, string funcType = null) { Type dt; if (funcType != null) { dt = typeof(Interop).GetNestedType(funcType) as Type; } else { dt = GetPrototype(method.Name); } if (dt == null) { return(ThunkInfo.Empty); } Delegate d = Delegate.CreateDelegate(dt, method); var info = new ThunkInfo(d); // TODO: remove keepAlive when #958 merged, let the lifecycle of ThunkInfo transfer to caller. keepAlive.Add(info); return(info); }
public void KeeapAlive(ThunkInfo thunk) { _keepalive.Add(thunk); }
public void Set(int offset, ThunkInfo thunk) { _slots[offset] = thunk; }