lz4-java icon indicating copy to clipboard operation
lz4-java copied to clipboard

StreamingXXHash issues

Open leventov opened this issue 5 years ago • 2 comments

  1. StreamingXXHash32JNI and StreamingXXHash64JNI should not override finalize(), it's bad for GC. Instead, they should use Cleaner.
  2. They should support close() for explicit resource release.
  3. The close() method should be synchronized to avoid racy free, this is a workaround in the absence of Reference.reachabilityFence().

leventov avatar Nov 29 '18 22:11 leventov

Thanks for the issue report.

  1. Agree, and I don't have a plan to upgrade to Java 9 in the near future, but will use Cleaner then.
  2. I'll work on it. Do you think it should implement the Closeable interface?
  3. Agree. I think all the other methods (reset, getValue, and update) must also be synchronized, correct?

odaira avatar Dec 02 '18 03:12 odaira

  1. Yes
  2. Yes

leventov avatar Dec 03 '18 14:12 leventov