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

Possibility to use custom allocators for nodes retrieved from cursors and queries #63

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Emmeral
Copy link

@Emmeral Emmeral commented Dec 11, 2024

Fixes #57

Allows to use a custom SegmentAllocator when retrieving node instances from cursors and queries. This allows for using the nodes even after the cursor / query has been closed. Also it gives the caller the opportunity to clear the memory of a node without closing the cursor / query in case a lot of nodes are retrieved without closing the cursor / query.

Note: This PR also removes the cached java node object in the TreeCursor class as we do now longer control the lifetime of its native memory. I hope this is ok as recreating it (in case somebody retrieves the same node twice) should not be that expensive.

@Emmeral Emmeral force-pushed the CustomNativeMemoryScope branch from 0a6adce to f60959d Compare December 12, 2024 14:06
@Emmeral
Copy link
Author

Emmeral commented Dec 13, 2024

I implemented the requested changes. Could you please re-review @ObserverOfTime ?

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.

Using a node outside of a cursors scope
2 participants