TypedReference result = default;
unsafe
{
+#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('TypedReference')
IntGetNextArg(&result);
+#pragma warning restore CS8500
}
return result;
}
TypedReference result = default;
unsafe
{
+#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('TypedReference')
IntGetNextArgWithType(&result, rth.Value);
+#pragma warning restore CS8500
}
return result;
}
unsafe
{
// Passing TypedReference by reference is easier to make correct in native code
+#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('TypedReference')
RuntimeFieldHandle.SetValueDirect(this, (RuntimeType)FieldType, &obj, value, (RuntimeType?)DeclaringType);
+#pragma warning restore CS8500
}
}
unsafe
{
// Passing TypedReference by reference is easier to make correct in native code
+#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('TypedReference')
return RuntimeFieldHandle.GetValueDirect(this, (RuntimeType)FieldType, &obj, (RuntimeType?)DeclaringType);
+#pragma warning restore CS8500
}
}
public static unsafe object? ToObject(TypedReference value)
{
+#pragma warning disable CS8500 // This takes the address of, gets the size of, or declares a pointer to a managed type ('TypedReference')
return InternalToObject(&value);
+#pragma warning restore CS8500
}
[MethodImpl(MethodImplOptions.InternalCall)]