Accessing an oop

Tim Olson tim at jumpnet.com
Tue Jun 22 21:54:41 UTC 1999


>Is there a way to access an Object's oop from within Squeak?  The best I
>could find was #asOop, but it's only half of the oop.

In Squeak there are 2 different kinds of Oops (Object Oriented Pointer?):

1) Smalltalk code accessible Oops, visible with "asOop"
     this Oop is a 12-bit random number built at object creation time and
     stored in the header word of the object.  Its main purpose is to 
provide
     a value to use for identity hashing.

2) the memory pointer value used in the virtual machine as an object
   reference.  This value directly points to the object header, and is
   subject to change during garbage collection.

#2 is not accessible in Smalltalk code, mainly because it can change from 
instant to instant, and therefore is not of any real use.

What are you attempting to do with the Oop value?  There probably is a 
better way to do it that doesn't involve trying to get an object's 
address.



     -- tim





More information about the Squeak-dev mailing list