POV-Ray : Newsgroups : povray.off-topic : Programming design question, related to GC : Re: Programming design question, related to GC Server Time
1 Oct 2024 13:19:45 EDT (-0400)
  Re: Programming design question, related to GC  
From: Darren New
Date: 14 May 2008 18:35:35
Message: <482b6937$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.