POV-Ray : Newsgroups : povray.advanced-users : the POV-ray SDL--similar to Java and/or Python? : Re: the POV-ray SDL--similar to Java and/or Python? Server Time
6 Oct 2024 20:19:16 EDT (-0400)
  Re: the POV-ray SDL--similar to Java and/or Python?  
From: Orchid XP v3
Date: 14 Sep 2006 13:30:37
Message: <450991bd@news.povray.org>
>   Btw, could you finally give me even a slight hint at how GC knows
> that an object is not used anylonger?
> 
>   I don't get it.

You mark every object that exists as "garbage". Then you take each 
global variable, local variable in currently running threads, etc. in 
turn, and you mark the object that variable points to as "not garbage". 
And then you find every object it points to and mark all those as "not 
garbage". And then all the objects that *those* objects point to, and so 
forth. Follow all the pointers until you stop finding objects that 
aren't already marked.

At this point, anything still marked "garbage" gets deleted.

Simple, really. And slow. And various optimisations make it go much faster.


Post a reply to this message

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