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

cuvs-java: Refactor method handle usage and separate out local areas from long held #628

Open
wants to merge 1 commit into
base: branch-25.02
Choose a base branch
from

Conversation

ChrisHegarty
Copy link

This change refactors the native downcall method handles so that they are static final constants - which optimise better by the JVM. It's also the generally accepted pattern, where the handles are tied to the lifetime of class which effectively mediates access - by virtue of reachability.

Additionally,

  1. the error codes from native calls are plumbed in and checked.
  2. a state is added to any classes that hold a reference to native resources that could be released.
  3. a local arena is used for memory allocation only needed per downcall invocation, e.g. the return value.

Copy link

copy-pr-bot bot commented Jan 30, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cjnolet cjnolet added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Jan 30, 2025
@cjnolet
Copy link
Member

cjnolet commented Jan 30, 2025

/ok to test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants