get instance using the hash value?

TECHIN.A.KANG at mail.sprint.com TECHIN.A.KANG at mail.sprint.com
Mon May 28 15:30:41 UTC 2001


ComSwiki is the application. I shutdown the Comanche Server, exit
squeak. Run squeak, do someting, exist squeak. And ...

Somehow I notice this suitation:

      The Comanche server is NOT running.
      When I execute "SwikiShelf allInstances". I got an Instance of it.
      When I run Comanche to startup swiki, I get 2 SwikiShelf instance.
      When I shutdown the Comanche, the lastest SwikiShelf goes way, but
not the first one,which is always there!

Side Question: how do I track down the objects holding this SwikiShelf?

Thanks,
Techin Alex Kang


-----Original Message-----
From: ok [mailto:ok at atlas.otago.ac.nz]
Sent: Sunday, May 27, 2001 10:29 PM
To: squeak
Cc: ok
Subject: Re: get instance using the hash value?


      An object has a hash value (self hash).
      
      1.    How can I get hold of an object with its hash value?
            anInstance _ AClassCanCreateInstanceUsingHashValue hash:
2340
      
It is in the nature of hash codes that they are not unique.
There could be many thousands of objects with that hash code.
Hash codes are not pointers, they're just a hack to speed up table
lookups.

I haven't checked:  does Squeak 3.x still use 12-bit hash codes?

      2.    If I can get hold of an instance, how can I destroy it?
      
Unseemly hacking in the VM aside, you can't.
Smalltalk objects can survive anything except the death of (their)
universe
and insufficient attention.  If you stop looking at them, they pine
away.

What you _can_ do is hunt down variables holding references to an object
and
nil them out, whereupon the object will eventually pine away because
no-one is interested any more.

What is the application problem you are trying to solve by these means?




More information about the Squeak-dev mailing list