On Sat, Apr 30, 2016 at 7:49 PM, Brandon Allbery <allber...@gmail.com> wrote:
> On Sat, Apr 30, 2016 at 3:05 PM, Kaare Rasmussen <ka...@jasonic.dk> wrote: > >> sub poll(CArray[Pollfd], uint64, uint32) returns int32 is native { * } > > > This, unfortunately, means an array of pointers to Pollfd structs, not an > array of Pollfd structs. NativeCall doesn't support the latter currently, > as I understand it. > In fact, this is currently being discussed in IRC: [30 23:47] <timotimo> ah, yes, CArray of CStruct is an array of pointers to structs [30 23:47] <timotimo> https://github.com/MoarVM/MoarVM/blob/master/src/6model/reprs/CArray.c#L53 - check these lines [30 23:48] <sortiz> zwu, If you need to pass an inline array of CStructs to C you can use NativeHelpers::CStruct, from NativeHelpers::Blob. [30 23:48] <timotimo> nice [30 23:49] <sortiz> See: https://github.com/salortiz/NativeHelpers-Blob/blob/master/t/02-cstruct.t [30 23:50] <timotimo> we might want to offer a deprecation cycle for CArray of CStruct and ask users to use CArray[CPointer[type]] instead? -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net