jpountz/lz4-java — pull request #33 by Shohou (2014-01-28 14:01:10+00:00)
Title: Using Java unsafe implementation crashes JVM on Solaris sparcv9 with 64 bit JVM

Hi,
Using lz4 under solaris sparcv9 with 64bit jvm is not possible at the moment. If I use LZ4Factory.fastestInstance() and factory.fastCompressor() it tries to use Unsafe and once it does so, JVM crashes with problematic frame [libjvm.so+0xc5212c] Unsafe_GetInt+0x158. I looked at the java DirectByteBuffer and saw that Java checks for architecrure before using Unsafe and if it is not one of the known, it reads ints and longs by bytes.
This commit changes UnsafeUtils to check os.arch and if it is not one of the known, it reads ins and long byte by byte.
Running under 32 bit java on solaris passes all tests. Running under 64 bit java passes all tests except those that use native library, for some reason native library doesn't work for me. It crashes at some point. Maybe I just dont know how to compile it.