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 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!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Fri, 11 May 2018 13:57:15 +0300 Organization: Tidorum Ltd Message-ID: References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87zi1gz3kl.fsf@nightsong.com> <878t8x7k1j.fsf@nightsong.com> <87k1sg2qux.fsf@nightsong.com> <87h8njmk4r.fsf@nightsong.com> <87po27fbv9.fsf@nightsong.com> <87h8nhwhef.fsf@nightsong.com> <87d0y4zf7d.fsf@nightsong.com> <871sejyp8d.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 2c7IpkcxUbbbgQvmALydYAm59QvkNBE6zT+6vR5T7p8DmEm8Mm Cancel-Lock: sha1:MSP0Lp7ET0lClOz1WzNqW4MmpG8= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader02.eternal-september.org comp.lang.ada:52262 Date: 2018-05-11T13:57:15+03:00 List-Id: On 18-05-11 13:04 , Dmitry A. Kazakov wrote: > On 11/05/2018 03:07, Paul Rubin wrote: [snip] >> That's in contrast with >> conservative GC where the runtime can't necessarily figure out the types >> of all the objects. Conservative GC is a terrifying concept in theory, >> but it works surprisingly well in practice. It has been used in Ada in >> the past. > > [snip] And even with statically known types the > pointers might be not statically known: > > type My_Integer (Indirect : Boolean := False) is record > case Indirect is > when True => > Reference : access Integer; > when False => > Value : Integer; > end case; > end My_Integer; That would not bother a conservative GC much; it would use the record's contents as potential pointers (to whatever type of object) without caring about the value of the Indirect discriminant. If Indirect = False, but the Value happens to be a valid pointer to or into a heap object, the conservative GC would consider the heap object "reachable" and refrain from collecting it. So collection would not find all the garbage, but usually it would find most of it. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .