From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation with tagged types Date: Sun, 18 Apr 2021 17:53:11 +0200 Organization: Adalog Message-ID: References: <607b56f8$0$3721$426a34cc@news.free.fr> <07863309-4541-4497-8cec-d88179e634bdn@googlegroups.com> <3d6e49b6-f195-4dc2-bf4b-795f18f2da9dn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 18 Apr 2021 15:53:10 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="f0f9e4c3d5298889098215edf4b3a449"; logging-data="9598"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dP3yb4BsEkerIi4AQsFPi" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 Cancel-Lock: sha1:FrZbV2SDumx/omQiTG/+Ffg2IOg= In-Reply-To: <3d6e49b6-f195-4dc2-bf4b-795f18f2da9dn@googlegroups.com> Content-Language: fr Xref: reader02.eternal-september.org comp.lang.ada:61825 List-Id: Le 18/04/2021 à 17:23, Gautier write-only address a écrit : > Le dimanche 18 avril 2021 à 17:14:13 UTC+2, J-P. Rosen a écrit : > >> I meant it the other way round: if the module has no "with >> unchecked_deallocation", you know it does not deallocate anything, >> without looking at the entire body. > > Not at all: the instantiation can be defined of in another package - and it is often the case - with any name (Free, Dispose, ...). > So actually with the present way it is difficult to track where unchecked deallocation is used, plus it is tedious for the programmers. > The P'Free atttribute or the "unchecked_free P;" statement would be straightforward to track. > Well, P'Free can also be in another package... Of course, we are talking here only about the direct, actual deallocation. If you want to precisely know where deallocation is used, use AdaControl (for any solution). If you want to be confident that there is no direct deallocation in a module, the generic wins. And after all, the attribute only saves you one line of code... (OK, two if you count the "with" ;-) ) -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr