Issues with Marshalling arrays of user defined types

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Issues with Marshalling arrays of user defined types

Phyx
Hi All,

I’ve been scratching my head for weeks trying to figure out what goes wrong with the code pasted below.

It’s compiled to a shared library (dll) on windows. I know the Storable instance is correct because calls to testFooA works, but calls to testFooListA get an invalid pointer back.

Lists of Ints do work fine, so it seems that newArray is also working. In GHCi it can dereference the pointer. And this used to work before in earlier GHC 7.0 and later 6.6 builds.

Using WinDBG and gflags I see that the pointer is indeed invalid, but that the *valid* data is there in the heap.

The example code can be found at http://lpaste.net/6148884045213204480

Anyone have an idea what I’m doing wrong?

Kind Regards,
Tamar


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe