Can the FFI deal with arrays? If so, how?

后端 未结 4 1296
终归单人心
终归单人心 2021-01-01 14:37

I\'m pretty sure it\'s possible to send arrays through the FFI, but I can\'t find any examples. For instance, I have a Haskell array that I send to a int foo(int*)

4条回答
  •  不知归路
    2021-01-01 15:11

    The FFI specification is quite readable, so you might want to just sit down and work through the whole thing. However, for this specific question, you can jump to the "Marshalling" section, particularly the Ptr and Storable subsections, which outline what's available for this.

提交回复
热议问题