-
Notifications
You must be signed in to change notification settings - Fork 1
feat: allocate FFI output from Rust #70
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
base: develop
Are you sure you want to change the base?
Conversation
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
I just checked on Dart, it seems hard to do the same thing… I'll continue to investigate. |
Co-authored-by: Manuthor <32013169+Manuthor@users.noreply.github.com>
Something like this may work: final bytes = Pointer.fromAddress(output.value).cast<Uint8>();
malloc.free(bytes);
return deserializeSearchResults(
bytes.asTypedList(outputLengthPointer.value),
); |
e8069e5
to
d0603d2
Compare
In order to avoid allocating an upper bound on the amount of memory needed in the FFI caller, I propose the following workaround:
This MR applies this method to the FFI API of Findex upsert. The Rust implementation can be found in the Rust repository. All tests pass on my machine.
I need particular proofreading on the free step (5) and potential incompatibilities with a Flutter/C implementation.