PerlFFI / FFI-Platypus

Write Perl bindings to non-Perl libraries with FFI. No XS required.
89 stars 23 forks source link

Support returning (some) records-by-value from a closure #315

Closed plicease closed 3 years ago

plicease commented 3 years ago

We can't really return a record pointer because the thing pointed to would be immediately de-allocated and we can't return records with pointers to strings because the strings would be de-allocated, but we can return records by-value otherwise. If you do really need a string member to your record, you can strdup it and store it as an opaque. Be careful of the allocation though!