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=-1.9 required=5.0 tests=BAYES_00,XPRIO autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to get Ada to 'cross the chasm'? Date: Fri, 11 May 2018 17:39:09 -0500 Organization: JSA Research & Innovation Message-ID: Injection-Date: Fri, 11 May 2018 22:39:10 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="13123"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:52303 Date: 2018-05-11T17:39:09-05:00 List-Id: Niklas Holsti" wrote in message news:flkvhfF1m7fU1@mid.individual.net... > On 18-05-10 01:05 , Randy Brukardt wrote: >> "Niklas Holsti" wrote in message >> news:flegbrFj0qjU1@mid.individual.net... >>> On 18-05-04 01:27 , Randy Brukardt wrote: >>> >>> [snip] >>> >>>> There is no realistic chance that Ada will >>>> ever be changed enough to make it amenable to GC. > > [snip] > >> If one uses the canonical linked-list >> implementation of finalization, objects with controlled parts remain >> reachable until the appropriate master goes away -- so nothing gets >> collected. (And a similar effect is necessary regardless of how >> finalization >> is implemented.) There still can be an underlying GC and it can be used >> just >> fine -- no one said anything about it actually be able to collect much. > > Can one summarize the effect of the current Ada rules as follows: > > - for dynamically allocated objects that do not need finalization, a GC > implementation could release them when they become unreachable, just as in > other languages, > > - for objects that do need finalization, a GC implementation would have to > delay releasing the objects until their types go out of scope, which in > most cases would not happen before the program is about to terminate? > > If so, the conclusion is that GC is becoming ineffective for Ada, because > Ada programming style is changing to make more use of controlled types and > finalization. Correct, this is a perfect summary. Perhaps it should be clarified that these are all objects designated by some access type, but of course you don't need any way to deallocate local objects - they go away for free. Randy.