POV-Ray : Newsgroups : povray.off-topic : Question about garbage collection (not a flame) : Re: Question about garbage collection (not a flame) Server Time
1 Oct 2024 15:18:53 EDT (-0400)
  Re: Question about garbage collection (not a flame)  
From: Orchid XP v8
Date: 31 Mar 2008 14:45:17
Message: <47f13f4d$1@news.povray.org>
>>> Circular references seem to be a bit like goto: You can come up with all
>>> kinds of situations where it's "necessary", but in practice it happens
>>> rarely if at all.)
> 
>> I disagree. Doubly-linked lists, trees with pointers up the nodes, 
>> widgets with child widgets that have parent pointers, etc. Pretty much 
>> everything "OO" is good at winds up generating circular references.
> 
>   Yet, as I said, languages like PHP and Objective C seem to use
> reference counting without too many problems.

Well given a long chain of objects pointing to objects, and a pure 
reference counting system, each scan of the GC will only reclaim *one* 
object from the chain. If the chain is long, it could take a damn long 
time to reclaim all that memory.

Reference counting really is far too simplistic to work properly. I have 
no idea how other languages appear to make it work [probably by 
suplimenting it], but I wouldn't trust it as far as I could throw it. ;-)


Post a reply to this message

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