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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a37:6188:: with SMTP id v130mr8324268qkb.483.1618762139115; Sun, 18 Apr 2021 09:08:59 -0700 (PDT) X-Received: by 2002:a25:dfd0:: with SMTP id w199mr11522848ybg.92.1618762138914; Sun, 18 Apr 2021 09:08:58 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 18 Apr 2021 09:08:58 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1206:4564:bea0:cd33:76d0:7b15:b095; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 2a02:1206:4564:bea0:cd33:76d0:7b15:b095 References: <607b56f8$0$3721$426a34cc@news.free.fr> <07863309-4541-4497-8cec-d88179e634bdn@googlegroups.com> <3d6e49b6-f195-4dc2-bf4b-795f18f2da9dn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Unchecked_Deallocation with tagged types From: Gautier write-only address Injection-Date: Sun, 18 Apr 2021 16:08:59 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61827 List-Id: > 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. It loses because you can have direct, immediate deallocation without the "with Ada.Unchecked_Deallocation" somewhere in the context clause. pack.ads: with Ada.Unchecked_Deallocation; package Pack is type IA is access Integer; procedure Release is new Ada.Unchecked_Deallocation (Integer, IA); end; ---- proc.adb: with Pack; procedure Proc is use Pack; P : IA; begin P := new Integer; Release (P); end;