comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Q: on redefinition of "=
Date: 1996/04/02
Date: 1996-04-02T00:00:00+00:00	[thread overview]
Message-ID: <Dp92G6.KI5@world.std.com> (raw)
In-Reply-To: 4jrsumINN9m0@snoopy.cis.ohio-state.edu

In article <4jrsumINN9m0@snoopy.cis.ohio-state.edu>,
david scott gibson <dgibson@snoopy.cis.ohio-state.edu> wrote:
>The strategy I'm currently working with uses null-bodied Initialize
>and Finalize routines for wrapped scalars.  I provide an initial value
>with a record component initialization.

So why use a controlled type?  Perhaps because *some* of your types need
Initialize or Finalize, and you want to inherit from a single root type
which has Swap.  Well, I wonder if you could have a non-controlled root
type with Swap, and extend it with controlled components in the cases
where you need that functionality?

>...  The lack of a valid
>representation is the problem, however, not the lack of a specific
>initial value for scalars.  Since the representations don't have any
>controlled sub-components, I'm assuming that the Initialize and
>Finalize calls for wrapped scalars can be optimized away.

They can, so long as you don't have class-wide stuff.  But I doubt if
they *are*, in a typical compiler.

>...I realize
>the tagged types will require more storage, but does GNAT's
>implementation entail an additional performance penalty in this
>situation?

I believe so.  Every controlled object will be hooked onto a chain
(doubly-linked, I think), of controlled objects.

>>Also, a plain old (non-controlled) record type can have automatic
>>initialization for its components.
>
>Yes, I've still got this implementation around.  It suffers from all
>of the same type conversion annoyances and requires explicit
>importation of Swap everywhere.

...or use "is <>" default for Swap.

>...  However, it should be more efficient.
>Once GNAT is compiling everything, I'll do some performance
>comparisons and get an idea of just how costly the tagged scalars
>implementation is.

- Bob




  reply	other threads:[~1996-04-02  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-30  0:00 Q: on redefinition of "= david scott gibson
1996-04-01  0:00 ` Tucker Taft
1996-04-01  0:00   ` david scott gibson
1996-04-01  0:00     ` Robert Dewar
1996-04-02  0:00       ` Mike Young
1996-04-02  0:00         ` Robert Dewar
1996-04-02  0:00           ` david scott gibson
1996-04-02  0:00             ` Robert A Duff
1996-04-02  0:00               ` david scott gibson
1996-04-02  0:00                 ` Robert A Duff [this message]
1996-04-02  0:00                   ` david scott gibson
1996-04-02  0:00             ` Robert Dewar
1996-04-03  0:00             ` Tucker Taft
1996-04-01  0:00 ` Robert A Duff
1996-04-01  0:00   ` david scott gibson
1996-04-01  0:00     ` Robert A Duff
replies disabled

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