jdk6 missed method sun.misc.Unsafe#copyMemory(Object, long, Object, long, long)

Kelly O'Hair kelly.ohair at oracle.com
Thu Jan 17 09:04:56 PST 2013


I am extremely reluctant to approve any changes to openjdk6 at this date.
But I am willing to listen to the community if there is a very good justification to get this in.

-kto

On Jan 15, 2013, at 2:21 AM, Alex Kasko wrote:

> 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



More information about the jdk6-dev mailing list