public static int *ConvertToUnmanaged(IntWrapperWithoutGetPinnableReference managed) { int *ret = (int *)Marshal.AllocCoTaskMem(sizeof(int)); *ret = managed.i; return(ret); }
public void FromManaged(IntWrapperWithoutGetPinnableReference managed) => _managed = managed;
public static ref int GetPinnableReference(IntWrapperWithoutGetPinnableReference wrapper) => ref wrapper.i;
// We explicitly throw here as we're expecting to use the stateless GetPinnableReference method public void FromManaged(IntWrapperWithoutGetPinnableReference managed) => throw new NotImplementedException();