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

[WIP] Reject callback with :string return type #782

Merged
merged 1 commit into from May 27, 2020

Commits on May 24, 2020

  1. Reject callback with :string return type

    Callbacks returning a :string type were not supported so far and did not work.
    It was possible to define such a callback, but the value returned was NULL in any case.
    This implementation rejects :string return type of callbacks at the definition.
    
    The reason for the reject is the following:
    In contrast to :string parameters to called functions there is no well defined ownership of the memory of the string returned by callbacks.
    Instead an explicit FFI::MemoryPointer or similar should be used, which allows to track the validity of underlying memory instead of relying on some Ruby implementation details.
    
    Fixes ffi#751
    larskanis committed May 24, 2020
    Copy the full SHA
    e2b1c7e View commit details
    Browse the repository at this point in the history