Skip to content

Conversation

@andygrove
Copy link
Member

Which issue does this PR close?

N/A

Rationale for this change

FFI is complex. I'd like it documented so that I do not need to keep re-learning how this works. I hope this will be useful for other contributors as well.

What changes are included in this PR?

New docs.

How are these changes tested?

@andygrove andygrove changed the title docs: Add FFI docs ot contributor guide [WIP] docs: Add FFI docs to contributor guide [WIP] Oct 30, 2025
@andygrove andygrove changed the title docs: Add FFI docs to contributor guide [WIP] docs: Add FFI docs to contributor guide Oct 30, 2025
@andygrove andygrove marked this pull request as ready for review October 30, 2025 15:48
Copy link
Member

@wForget wForget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, thanks @andygrove

@mbutrovich
Copy link
Contributor

Just to clarify: does "ownership transfer" mean "the code responsible for cleaning up the originally allocated data" i.e., the data still resides possibly on the other side of a JNI boundary, or does it mean that "data was deep copied across the JNI boundary so the original copy is not necessary?"

@andygrove
Copy link
Member Author

Just to clarify: does "ownership transfer" mean "the code responsible for cleaning up the originally allocated data" i.e., the data still resides possibly on the other side of a JNI boundary

Yes. The Arrow C Data Interface is designed to transfer ownership of data across a JNI boundary by passing a pointer to a callback to delete the data. For example, the ArrowArray struct has:

  // Release callback
  void (*release)(struct ArrowArray*);

@andygrove
Copy link
Member Author

Just to clarify: does "ownership transfer" mean "the code responsible for cleaning up the originally allocated data" i.e., the data still resides possibly on the other side of a JNI boundary

Yes. The Arrow C Data Interface is designed to transfer ownership of data across a JNI boundary by passing a pointer to a callback to delete the data. For example, the ArrowArray struct has:

  // Release callback
  void (*release)(struct ArrowArray*);

I pushed a commit to clarify this in the docs.

@mbutrovich mbutrovich merged commit 796d445 into apache:main Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants