comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <nholsti@icon.fi>
Subject: Re: Freeing Pointers to classwide types
Date: 1998/10/11
Date: 1998-10-11T00:00:00+00:00	[thread overview]
Message-ID: <362081E9.5CF38122@icon.fi> (raw)
In-Reply-To: m3r9whuzak.fsf@mheaney.ni.net

Matthew Heaney wrote:
> 
> Niklas Holsti <nholsti@icon.fi> writes:
> 
> > Matthew Heaney wrote:
> >   [snip]
> > >
> > >    type T_Access is access all T'Class;
> > >    for T_Access'Storage_Size use 0;
      [snip]
> > In fact, the above code elicits the following message from GNAT:
> > "Warning: implicit call of Initialize will raise Storage_Error."

First, let me correct myself: GNAT actually warns that the implicit
Initialize call will raise Program_Error, not Storage_Error.
Moreover, this occurs with a rather old GNAT version (3.05); the
version in WebAda does not emit this warning, so it was probably a
fault in the old GNAT. Sorry for this confusion.

> If you call new for an access type whose storage size is 0, then you'll
> get Storage_Error.

I don't think the LRM says precisely that. Storage_Error is raised
if there is not enough storage, but defining Storage_Size
as zero does not mean that the available storage is zero, since the
compiler can make the storage pool larger than requested. Of course
this may be an insignificant quibble, if all compilers actually
provide exactly the requested size.

On the other hand, it seems that GNAT (in WebAda) lets one specify
a positive Storage_Size for an access type to a descendant of the
type T, so it would seem possible for clients to use "new" for
descendant types. Doesn't this break your approach?

- Niklas




  reply	other threads:[~1998-10-11  0:00 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-24  0:00 Freeing Pointers to classwide types joecool
1998-09-25  0:00 ` Tom Moran
1998-09-25  0:00   ` dewarr
1998-09-25  0:00     ` Tom Moran
1998-09-25  0:00       ` dewarr
1998-09-26  0:00     ` Tom Moran
1998-09-26  0:00       ` dewarr
1998-09-26  0:00         ` Tom Moran
1998-09-27  0:00           ` dewarr
1998-09-27  0:00             ` Tom Moran
1998-09-28  0:00               ` dewarr
1998-09-28  0:00                 ` Tom Moran
1998-09-28  0:00                   ` dewarr
1998-09-28  0:00                     ` Tom Moran
1998-09-28  0:00                       ` Pat Rogers
1998-09-28  0:00                         ` Tom Moran
1998-09-28  0:00                           ` Pat Rogers
1998-09-29  0:00                           ` dewarr
1998-09-29  0:00                             ` Tom Moran
1998-09-30  0:00                               ` Tom Moran
1998-10-01  0:00                                 ` dewar
1998-10-01  0:00                                   ` Tom Moran
1998-10-01  0:00                                     ` dewarr
1998-10-01  0:00                                       ` Tom Moran
1998-10-01  0:00                                     ` dewarr
1998-10-01  0:00                                     ` Samuel Tardieu
1998-10-01  0:00                                       ` Tom Moran
1998-10-01  0:00                                         ` Tucker Taft
1998-10-01  0:00                                           ` Tom Moran
1998-10-02  0:00                                           ` dewarr
1998-10-02  0:00                                             ` Larry Kilgallen
1998-10-02  0:00                                               ` dewarr
1998-10-02  0:00                                           ` dennison
1998-10-02  0:00                                             ` dewarr
1998-10-01  0:00                                         ` dennison
1998-10-02  0:00                                         ` dewarr
1998-10-09  0:00                                           ` Matthew Heaney
1998-10-09  0:00                                             ` dennison
1998-10-09  0:00                                               ` Matthew Heaney
1998-09-28  0:00                       ` Tom Moran
1998-09-28  0:00                         ` Brian Rogoff
1998-09-28  0:00                   ` dewarr
1998-09-28  0:00                     ` Richard D Riehle
1998-09-28  0:00                       ` Pat Rogers
1998-09-29  0:00                       ` dewarr
1998-10-09  0:00           ` Matthew Heaney
1998-09-25  0:00   ` Bob Fletcher
1998-09-25  0:00     ` Samuel Tardieu
1998-09-25  0:00     ` dennison
1998-10-09  0:00     ` Matthew Heaney
1998-10-12  0:00       ` Mats Weber
1998-10-12  0:00         ` Pat Rogers
1998-10-09  0:00   ` Matthew Heaney
1998-09-25  0:00 ` alan walkington
1998-09-26  0:00 ` Simon Wright
1998-10-09  0:00 ` Matthew Heaney
1998-10-09  0:00   ` Niklas Holsti
1998-10-10  0:00     ` Matthew Heaney
1998-10-11  0:00       ` Niklas Holsti [this message]
1998-10-11  0:00         ` Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
1998-09-25  0:00 bpr5549
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox