-
Notifications
You must be signed in to change notification settings - Fork 45
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
Hyperscan java wrapper throws an exception when one scratch space is used with multiple databases #220
Comments
The reason for the bug is that every call private static class NativeScratch extends hs_scratch_t {
void registerDeallocator() {
if (deallocator() != null) {
hs_scratch_t p = new hs_scratch_t(this);
deallocator(() -> hs_free_scratch(p));
}
} @gliwka - lmk I can create a PR for that, but wanted to know what you think? |
@apismensky Thanks for the analysis. PR is welcome :-) |
Thanks for providing the fix @apismensky and for merging it @gliwka! Would it be possible to make a new release to easily make the fix available (and close this issue)? |
This article https://intel.github.io/hyperscan/dev-reference/performance.html#allocate-one-scratch-space-per-scanning-context says that one scratch space can be used with multiple databases. But this snipped of code produces an exception:
Most probably the bug is in the java wrapper, cause the following C++ code works fine (no error):
The text was updated successfully, but these errors were encountered: