Turn sun.misc.Unsafe into a public API

Alex Kasko alex.kasko.lists at gmail.com
Thu Oct 3 16:57:05 UTC 2013

On 10/03/2013 08:36 PM, Noctarius wrote:
> Am 03.10.2013 18:30, schrieb mark.reinhold at oracle.com:
>> 2013/10/3 1:51 -0700, me at noctarius.com:
>>> Is there already a group of people that is working on turning
>>> sun.misc.Unsafe into a clean public API or are there any interested
>>> people in trying to make a JEP / JSR out of it?
>> This is definitely something we plan to propose for SE 9.  I expect
>> to see a JEP from the current maintainers of sun.misc.Unsafe in the
>> near future.  (This is far too small to require a whole JSR.)
>> - Mark
> Good to know, thanks Mark. Looking forward to that and try to help
> on that :-)

I am also interested in such API.

sun.misc.Unsafe is used extensively by high performance libraries 
(snappy [1], kryo [2] and gson [3] to name some). I use it in everyday 
work (for off-heap memory access) with the naive approach to API - 
duplicated the same API with 'assert' checks on all memory access 
operations and run with '-ea' switch during testing.

Public API will allow much wider adoption, e.g. it would be great to 
have something like fastutil [4] backed by off-heap memory.

> - Chris

[1] https://github.com/dain/snappy
[2] http://code.google.com/p/kryo/
[3] http://code.google.com/p/google-gson/
[4] http://fastutil.di.unimi.it/

Alex Kasko

More information about the discuss mailing list