comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: Discriminated record question
Date: 8 May 2002 19:52:14 -0700
Date: 2002-05-09T02:52:14+00:00	[thread overview]
Message-ID: <5ee5b646.0205081852.4e2c20dc@posting.google.com> (raw)
In-Reply-To: udga38i7bj1g89@corp.supernews.com

"Randy Brukardt" <randy@rrsoftware.com> wrote in message news:<udga38i7bj1g89@corp.supernews.com>...
> Janus/Ada does that (in both Ada 83 and Ada 95). I used 
> to think that that was the only reasonable model, but it 
> is clear that the implicit heap use is a bad thing in 
> certain environments.

Alsys used to do this as well in Ada 83. Did anyone get
it quite right? Alsys did not allow such beasts to be
nested in full generality, since this leads to complex
non-contiguous representations. 

At least one other Ada 83 compiler trying this (Janus?)
had storage leaks, and was so nice as to warn you that
declaring the type would cause a storage leak.

(it is non-trivial to avoid storage leaks, if you allow
these implicit heap pointers to nest).

It is definitely a bad idea for a compiler. If you want
pointers and dynamic allocation, write it that way. As far
as I am concerned, for a language at the level of Ada, it
is a bad idea in *all* cases to do implicit heap allocations for a
type declaration of this kind.



  reply	other threads:[~2002-05-09  2:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-07 12:45 Discriminated record question Grein, Christoph
2002-05-07 19:18 ` Randy Brukardt
2002-05-09  2:52   ` Robert Dewar [this message]
2002-05-09 20:29     ` Randy Brukardt
2002-05-08 10:10 ` Mark Doherty
2002-05-09  2:56   ` Robert Dewar
2002-05-15 15:34     ` Mark Doherty
2002-05-15 18:12       ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
2002-05-16  5:03 Grein, Christoph
2002-05-07 12:17 Mark Doherty
2002-05-10  9:27 ` Emmanuel Briot
replies disabled

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