[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Usefull Refcon



   From: blakem@world.std.com (Blake Meike)

   I'd like to be able to find the lisp object that belongs to some
   of the Mac 'objects' I have floating around my program.  A standard
   technique is to put the 'name' of the lisp object into the refcon
   of the Mac 'object'.  But how do I convince lisp that the value that
   I get out of the refcon is really an object.

This is a very unsafe thing to do.  If a GC happens, your object
will move and the address in the refcon will not be updated.

The only safe way I can think of to do what you want is to keep
a hash table mapping integers to objects.  Then you can put the
integers in the refcon.

   -andrew