From: | Lex Spoon <lex@cc.gatech.edu> |
Newsgroups: | comp.compilers |
Date: | 4 Jul 2003 00:06:53 -0400 |
Organization: | Georgia Institute of Technology |
References: | 03-05-211 03-06-015 03-06-054 03-06-057 03-06-078 03-07-005 |
Keywords: | storage |
Posted-Date: | 04 Jul 2003 00:06:52 EDT |
Joachim's post is an excellent overview of automatic memory
management, but a couple of comments got under my skin. For the
record:
>> This scheme (reference-counting) is used in VB6 for instance.
>
> No, garbage-collected languages don't use reference counting.
Garbage collection is actually a general term that includes reference
counting. Note that no garbage collector is perfect, due to the
Infinite Employment Theorem for Compiler Writers. Good garbage
collection is as much of an optimization as, say, good register
allocation.
> > When I read its description, it sounded
>> like a rather elaborate scheme and one that would need a good deal of
>> implementation effort.
>
> That's true. Writing a good garbage collector takes several
> person-months or person-years.
Not necessarily. If nothing else, you can hook into the Boehm-Weiser
collector to get started:
> That's very correct. If you don't have a working garbage collector and
> don't have the budget for writing one, use reference counting.
> However, most of the time you have the Boehm-Demers-Weiser collector.
> It's written in C and will run on practically any hardware that can run C.
Also, the entire Squeak VM took only person-months to implement (I
don't know the exact time frame), and the garbage collector was just
one part of it.
Lex
Return to the
comp.compilers page.
Search the
comp.compilers archives again.