ffi_gen
ffi_gen copied to clipboard
by_ref should be used for returned structs
As seen here https://github.com/ffi/ffi/wiki/Structs#pointers-to-functions if a function returns a pointer to a struct, it should use SomeStruct.by_ref
as the return type. Otherwise, ffi returns an FFI::Pointer
.
Agreed.