Getting completely (I mean ENTIRELY) rid off GC
    Marco Leise via Digitalmars-d 
    digitalmars-d at puremagic.com
       
    Fri Sep 12 13:50:19 PDT 2014
    
    
  
Am Fri, 12 Sep 2014 15:43:14 +0000
schrieb "Chris" <wendlec at tcd.ie>:
> [Caveat: I'm no expert]
> I once read a manual that explained the GC in Objective-C (years
> ago). It said that some objects never get collected although
> they're dead, but the garbage collector can no longer reach them.
> But maybe that's true of other GC implementations too (Java?).
With only ARC, if two objects reference each other, they keep
each other alive indefinitely unless one of the references is a
"weak" reference, which doesn't count as a real reference
count and will cause the destruction.
Other than that, in case of Java or D it is just a question of
how you define "never" I guess. Since a tracing GC only runs
every now and then, there might be uncollected dead objects
floating around at program termination.
> [...] But that's not really a GC algorithm that scans and
> collects during runtime. Isn't it cheating?
A GC algorithm that scans and collects during runtime is
called a "tracing GC". ARC none the less collects garbage.
You, the programmer, don't need to do that.
-- 
Marco
    
    
More information about the Digitalmars-d
mailing list