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!gandalf.srv.welterde.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: little precision about anonymous access types Date: Thu, 17 May 2018 16:20:14 -0500 Organization: JSA Research & Innovation Message-ID: References: <42387d28-c983-4e58-9522-815ccd1ad0fb@googlegroups.com> <6c1e643d-b826-4b8b-b61c-13c56428ed23@googlegroups.com> <1fbd0763-bed4-49f5-a1c8-51a634e89eb2@googlegroups.com> Injection-Date: Thu, 17 May 2018 21:20:15 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="23680"; 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:52408 Date: 2018-05-17T16:20:14-05:00 List-Id: The better solution here is restriction No_Anonymous_Allocators (see H.4(8.1/3)). Using that restriction helps because it forces all allocation to named access types (for which you can do deallocation in all of the normal ways). This is just to note that Ada does have ways to mitigate this problem (I noted another one, pragma Default_Storage_Pool, in a previous message). The annoyance is that these things aren't the default. Randy. "Mehdi Saada" <00120260a@gmail.com> wrote in message news:1fbd0763-bed4-49f5-a1c8-51a634e89eb2@googlegroups.com... I may add, that the craziest thing was to allow the very possibly of using allocators with non-discriminant/non-parameter anonymous access (though I have no idea, and it's not easy to find, where and for how long goes things like values like my_func(new something', ...) types. Their existence, that forbid and uselessness aside, it wouldn't be that much of a loophole. At least provide a way to bind the objects' life time to something, dudes...