The following code is unsafe, because the GC is free to move the 'values' array once we're out of the fixed statement:
fixed (nfloat *ptr = values)
return (IntPtr) ptr;
this means that the calling function now has pointer to memory that the GC can move at any time.
Raising priority and targeting the next release (15.6), since this will cause random crashes (or other random behavior) when it occurs, and it will be very tricky to track down.
The manual bindings for CIVector has the same code.
CIVector fixed in https://github.com/xamarin/xamarin-macios/pull/3038
@Alex since you're working on MPS can you apply the same pattern on MPSKernel ? thanks!
Switching milestone to `xcode9.2` since it enables the framework on macOS (and will likely be merged into 15.5)
Fixed in xamarin-macios/xcode9.2 @ https://github.com/xamarin/xamarin-macios/commit/87f9e239898c16a64de153e6fb631b7ad8fb3865