comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent Guerby <guerby@acm.org>
Subject: Re: Access to classwide type
Date: 2000/07/25
Date: 2000-07-25T14:31:30+00:00	[thread overview]
Message-ID: <864s5eb7s7.fsf@acm.org> (raw)
In-Reply-To: 8li2f1$8q61@news.cis.okstate.edu

dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) writes:
> [...] I believe GNAT just implements it as a small wrapper around 
> C's free function.

For the default allocation pool in GNAT yes (gnat_free). 

In general at the language level, if you write your own pools, the
deallocation function (see System.Storage_Pools) has size and
alignment parameters, and the compiler has always a way to fill them
with the corresponding allocated parameters as required by 13.11.2
(9). So you know a bit more than C free.

I believe that for all tagged types, GNAT generates a few hidden
primitive subprograms to handle this in the class-wide case (see -gnatdg
expansion of 'size attributes on such beasts to make your mind ;-). I
don't know for other compiler technology.

For arrays and discriminated types, the compiler can obviously
generate small pieces of code to compute the size of things, since the
information must be around in some ways to do all the Ada required
checking.

-- 
Laurent Guerby <guerby@acm.org>




  reply	other threads:[~2000-07-25  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-23  0:00 Access to classwide type reason67
2000-07-24  0:00 ` David Botton
2000-07-24  0:00   ` reason67
2000-07-24  0:00     ` Pascal Obry
2000-07-24  0:00     ` Larry Kilgallen
2000-07-24  0:00       ` reason67
2000-07-24  0:00         ` Larry Kilgallen
2000-07-24  0:00         ` David Botton
2000-07-24  0:00     ` David Starner
2000-07-25  0:00       ` Laurent Guerby [this message]
2000-07-24  0:00     ` Pat Rogers
2000-07-25  0:00     ` Matthew J Heaney
replies disabled

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