Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
turboladen opened this issue Jul 30, 2021 · 0 comments
Open

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

turboladen opened this issue Jul 30, 2021 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@turboladen
Copy link
Contributor

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.

@turboladen turboladen added the bug Something isn't working label Jul 30, 2021
@turboladen turboladen added this to the 1.0 milestone Jul 30, 2021
@turboladen turboladen modified the milestones: 1.0, 1.x Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant