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

Rewind() called early in TransferContext #512

Merged
merged 6 commits into from
Oct 14, 2023
Merged

Conversation

CedNaru
Copy link
Member

@CedNaru CedNaru commented Oct 14, 2023

Implement #509

C++:
The idea is simple. Instead of having to call rewind() after any operation on the buffer, we simply rewind it as part of the get_buffer() method. (The buffer is stored directly inside that method, so it's the only way to get it).
The only manual rewind() left is the one in icall() as I need to reset it to write the return value.

Kotlin:
I decided to made TransferContext.buffer private (doesn't change its visibility from C++ through JNI). I don't think it should be used directly outside TransferContext, so I did a small rework of its methods.
The goal was to remove any manual call to rewind() in the rest of the code. Rewinding should be the responsibility of TransferContext alone.

@CedNaru CedNaru force-pushed the feature/early-rewind branch from 4a8d4f2 to 784010e Compare October 14, 2023 02:34
@CedNaru CedNaru requested review from piiertho and chippmann and removed request for piiertho October 14, 2023 03:32
@chippmann chippmann added enhancement New feature or request topic:core labels Oct 14, 2023
@CedNaru CedNaru requested a review from piiertho October 14, 2023 15:50
@CedNaru CedNaru force-pushed the feature/early-rewind branch from 93549f5 to 474a8a6 Compare October 14, 2023 15:52
@CedNaru CedNaru merged commit 41857e8 into master Oct 14, 2023
@CedNaru CedNaru deleted the feature/early-rewind branch October 14, 2023 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants