Unique Object ref?

Andrew C. Greenberg werdna at mucow.com
Tue Jul 4 08:43:50 UTC 2000


At 10:33 AM +0200 7/4/00, Johan Fabry wrote:
>Hi,
>
>I was wondering if there was a way to get an unique identifier to an
>Object, e.g. as an Integer. There is a method asOop in Object (calling a
>primitive), with comment "Answer a SmallInteger whose value is half of
>the reciever's object pointer [...]", but as this is only half the
>pointer, I am doubtful as to the uniqueness of this oop.
>
>So, is there a way to get a guaranteed unique oop?
>--
>"You are more than the sum       Johan Fabry - Johan.Fabry at vub.ac.be
>  of what you consume.            Vrije Universiteit Brussel
>  Desire is not an occupation."   Programming Technology Lab, Room 10F709
>   -- KMFDM                       Pleinlaan 2, 1050 Brussels, Belgium

The oop for a non-SmallInteger object will always be unique, but will 
change everytime the object is moved during garbage collection.  All 
equal SmallIntegers have the same oop.

For what purposes do you require a "unique identifier?"
-- 
Andrew C. Greenberg		acg at netwolves.com
V.P. Eng., R&D, 		813.885.2779 (office)
NetWolves Corporation		813.885.2380 (facsimile)
www.netwolves.com

Please use werdna at mucow.com instead of werdna at gate.net





More information about the Squeak-dev mailing list