Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Dennis Ritchie is twice as bright as Steve Jobs, and only half wrong. -- Jim Gettys


devel / comp.lang.ada / Re: Unchecked_Deallocation with tagged types

SubjectAuthor
o Re: Unchecked_Deallocation with tagged typesThomas

1
Re: Unchecked_Deallocation with tagged types

<625a4d8a$0$24798$426a34cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=6833&group=comp.lang.ada#6833

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!proxad.net!feeder1-2.proxad.net!212.27.60.64.MISMATCH!cleanfeed3-b.proxad.net!nnrp5-1.free.fr!not-for-mail
From: fantome....@free.fr.invalid (Thomas)
Newsgroups: comp.lang.ada
Mail-Copies-To: nobody
Subject: Re: Unchecked_Deallocation with tagged types
References: <607b56f8$0$3721$426a34cc@news.free.fr> <s5gq77$110s$1@gioia.aioe.org> <07863309-4541-4497-8cec-d88179e634bdn@googlegroups.com> <s5gt17$7d0$2@dont-email.me> <s5h167$2f0$1@dont-email.me> <s5h1vv$anq$1@gioia.aioe.org> <s5hic3$nab$1@dont-email.me> <3d6e49b6-f195-4dc2-bf4b-795f18f2da9dn@googlegroups.com> <s5hkl6$9bu$1@dont-email.me> <b37bc687-b72f-4bc4-858c-77dc9b878cffn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
Date: Sat, 16 Apr 2022 07:00:57 +0200
Lines: 64
Message-ID: <625a4d8a$0$24798$426a34cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 16 Apr 2022 07:00:58 CEST
NNTP-Posting-Host: 91.175.52.121
X-Trace: 1650085258 news-4.free.fr 24798 91.175.52.121:1646
X-Complaints-To: abuse@proxad.net
 by: Thomas - Sat, 16 Apr 2022 05:00 UTC

In article <b37bc687-b72f-4bc4-858c-77dc9b878cffn@googlegroups.com>,
Gautier write-only address <gautier_niouzes@hotmail.com> wrote:

> > 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;

what J-P. Rosen meant was that P'Free could be in the body of
Pack.Release, and then it would not be in Proc either.

perso i like the design with the "generic".
(I'm used to it anyway, although of course it's worse than not needing
explicit Deallocation.)

but the question is: why in the specification ???

actually i need to know more about your case:

- do you find it ok to put the access types in the package
specification, and then not have control over what they become?

- or don't you want that, but you regularly become in situations where
you have no choice (for example because you need components of which you
are not the author)?

what's your opinion about String_Access and Free in
Ada.Strings.Unbounded?

I don't understand what they are doing here, since this package is made
to avoid needing them...

--
RAPID maintainer
http://savannah.nongnu.org/projects/rapid/

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor