Skip to content

Cull through ffi/**/*.rb and ensure string/pointer soundness #25

@turboladen

Description

There are quite a few GDAL functions that return strings that shouldn't be modified once returned to Ruby. For some of these, I've used :strptr as a return type, but after some more reading, that doesn't seem right.

In the Types page, it says:

:string should be considered to be const char * and the Ruby string must not be changed as long as it’s accessed by the library. If the string buffer shall be modified from C or Ruby side, use :pointer and FFI::MemoryPointer instead.

I think the attach_function calls should return :string, then in the wrapper functions, those values should be made frozen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions