From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.misc:1401 comp.lang.modula2:749 comp.lang.ada:1099 Path: utzoo!mnetor!uunet!husc6!uwvax!oddjob!gargoyle!att-ih!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.misc,comp.lang.modula2,comp.lang.ada Subject: Re: Garbage Collection Message-ID: <4265@ihlpf.ATT.COM> Date: 4 Apr 88 23:14:21 GMT References: <145@krafla.rhi.hi.is> <272@fang.ATT.COM> <429@zap.UUCP> <8196@sol.ARPA> <628@ra.rice.edu> <26358@cca.CCA.COM> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Followup-To: comp.lang.misc Organization: AT&T Bell Laboratories - Naperville, Illinois List-Id: [followups to comp.lang.misc] In article <26358@cca.CCA.COM> g-rh@CCA.CCA.COM.UUCP (Richard Harter) writes: > There is problably something I am missing, but I don't quite see >how you can implement garbage collection in C without collateral assumptions >-- how is the garbage collector supposed to know that that a block is free? The only way to do this is to allocate a giant heap with malloc() and do *all* the memory management on your own. It is no different than implementing in C or C++ a language that does automatic garbage collection. The problem I found with languages that do automatic garbage collection is that there is no way for me to modify the implementation of the class (or the type, for those of you unfamiliar with C++ lingo :-)) to make it better suit my needs. For applications where the programmer cost is greater than the run-time cost (such as prototypes, personal tools, one-shot programs), I tend to use languages with built in memory management. For other applications, however, I would rather use a language like C++ which allows me to change the implementation of a class without affecting the rest of my code. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_