lz4/lz4-java

StreamingXXHash issues

Opened this issue · 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().

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?
  1. Yes
  2. Yes