question about Unsafe.allocateInstance

Li Li fancyerii at gmail.com
Fri Dec 23 11:14:14 UTC 2011


hi all,
     I want to allocate and free memory as c/c++ language and I found the
Unsafe in hotspot vm. I know the danger of using this class. But I still
want to try it.
     allocateMemory and freeMemory are hard to use because I can't deal
with primitive types such as int long and need convert them to byte arrays.
     And I also find a method named allocateInstance, which seems what I
want. it just allocate space for this object. I don't know the memory is in
heap or direct memory. if it's in direct memory, it should exist a method
like freeInstance, but I don't find such one.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20111223/ca2afc85/attachment.htm>
-------------- next part --------------
_______________________________________________
hotspot-gc-use mailing list
hotspot-gc-use at openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use


More information about the hotspot-gc-dev mailing list