I’ve just got around to testing the new build. It seems that the multidimensional array in both the struct and a locally declared variable are still being allocated as pointers. A new error has now occurred, in which the library function cannot be found under the release build (Inline method not found). This does not happen under debug build. The attributes are correct to mark it as an exported function, along with the DLL Import function. I’ve uploaded the test case. The compiled shared library will need to be manually added to the correct binary directory before running.
I’m told this is as designed for Mercury. Because VB.NET allows all arrays to be redim’ed, they will all always be treated as s=dynamic arrays, even when declared with a fixed/initial size.
reproduced. this is a regression from before, and was fine esrlier?
It seems to be as I’ve compiled in release mode fine previously.
Is it possible to provide an attribute, mainly for the Island back end that explicitly allows this? VB.net had a fixed string/array attribute to assist with this quirk for marshalling with C API’s.
Here were the original attributes, however I feel they’re a bit limited given it was more for the original nature of QB/VB prior the .NET era:
Ideally, I’d believe an attribute that forces (in this case, arrays of n-dimension) to be stack defined or block allocated (within structures) is the best approach.
Example:
<Fixed, Packed>
Structure test
t(2) As Double
m(2,2) As Double
End Structure
Size of test should be 72 instead of 16. Fixed enforces this.