|
 |
Warp wrote:
> Can you mention some popular GC's languages where it's possible to
> implement reference-counting of objects?
Actually, thinking about this, it's really not possible the way you mean
it. How would you say which object's reference count went to zero? As
soon as you say "Remember that open file? Its reference count went to
zero," the reference count isn't zero any more. Which is why finalizers
always have problems with being "resurrected" during finalization.
So, I guess it's impossible to implement weak references yourself in the
same language as you access the references (i.e., as a library). If you
can return the strong reference from your library, the weak reference
can't be collected. Cool.
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
 |