A question about getting object address with sun.misc.Unsafe class

Discussion in 'Java' started by James, Jan 26, 2008.

  1. James

    James Guest

    Dear all,

    I'm wondering why sun.misc.Unsafe class allow us getting address of an
    object. I'm assuming that address will be changed by GC so it's really
    UNSAFE to use that address in any situation.

    Is there any useful usage of this object address from using UnSafe
    class?

    Thanks a lot!

    James Gan
    James, Jan 26, 2008
    #1
    1. Advertising

  2. James

    Roedy Green Guest

    On Sat, 26 Jan 2008 06:21:39 -0800 (PST), James <>
    wrote, quoted or indirectly quoted someone who said :

    >Is there any useful usage of this object address from using UnSafe
    >class?


    I think serialisation uses it. It might be useful in debugging.
    --
    Roedy Green, Canadian Mind Products
    The Java Glossary, http://mindprod.com
    Roedy Green, Jan 28, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page