----- Original Message ----- > Hello, > > Method sun.misc.Unsafe#copyMemory(Object,long,Object,long,long) is > used > in popular Snappy codec implementation [1, 2]. > > It's present in openjdk-7 and in late updates of Oracle jdk6. But > it's > missed in openjdk-6. Its native implementation is available in jdk6 > hostspot [3], though. As far as I understood, it was removed from > jdk6 > codebase during preparation to first jdk6 release [4]. I tried to > restore it in jdk6 sources (left hotspot untouched) and it seems to > work > well. > > Can someone clarify, whether it's safe to patch sun.misc.Unsafe and > use > this method in jdk6? > > > [1] https://github.com/dain/snappy#snappy-in-java > [2] > https://github.com/dain/snappy/blob/01f0a37ca40196e08336532ea6d328eb3ed22b67/src/main/java/org/iq80/snappy/UnsafeMemory.java#L101 > [3] > http://hg.openjdk.java.net/jdk6/jdk6/hotspot/file/cd74fab0a5e3/src/share/vm/prims/unsafe.cpp > [4] > http://hg.openjdk.java.net/jdk6/jdk6/jdk/diff/39e8fe7a0af1/src/share/classes/sun/misc/Unsafe.java > > -- > Regards, > Alex Kasko >
It will be in HotSpot because the same HotSpot releases are shared between 6 & 7 (well, they were until 6 stopped at hs20). Support for features in 8 will likewise appear in 7's HotSpot. I can't see any reason why it couldn't be backported, but presumably there was some reason it was removed. -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07