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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3a7c118fd2cc64f9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: A hole in Ada type safety Date: Sun, 08 May 2011 10:46:05 +0200 Message-ID: <87oc3dtwaa.fsf@mid.deneb.enyo.de> References: <87oc3odtci.fsf@mid.deneb.enyo.de> <87tydfbtp3.fsf@mid.deneb.enyo.de> <87d3k2u36e.fsf@mid.deneb.enyo.de> <877ha2op0n.fsf@mid.deneb.enyo.de> <87oc3en898.fsf@mid.deneb.enyo.de> <1mwaabp60tuqi$.1cbqxk0do4ic$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ruchba.enyo.de 1304844365 1495 172.17.135.6 (8 May 2011 08:46:05 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:YilYIPYmkhYV2HLXogNMi1GJ5JQ= Xref: g2news2.google.com comp.lang.ada:20159 Date: 2011-05-08T10:46:05+02:00 List-Id: * Dmitry A. Kazakov: > I mean a schema which could be usable for Ada. I see many problems, apart > from tasking. If you want to refer components, you need to add the parent's > count to the component's count in order to prevent its zeroing. The component wouldn't have its own count. A reference to a component would consist of a pointer to the component, combined with a pointer to the reference counters for the outmost object. > When you create a reference you have to check if the counts already > exist somewhere. Since nothing is allocated in the object, where > get that information from? You would only be able to create a reference from prefixes which contain references at certain points. For everything else, you'd have to use access values, as before. > IMO weak references are quite useless if do not support notifications (when > the last strong reference is removed). I.e. you need a list of weak > reference holders. I think they are supposed to be used for parent pointers in trees, for instance, to avoid the cycle issue. Not so much for finalization.