comp.lang.ada
 help / color / mirror / Atom feed
From: "Greg Bek" <gbek_nospam@removethis.bigpond.net.au>
Subject: Re: Apex 4.2 question about records
Date: Sun, 17 Nov 2002 23:04:51 GMT
Date: 2002-11-17T23:04:51+00:00	[thread overview]
Message-ID: <ngVB9.10338$nK4.23002@news-server.bigpond.net.au> (raw)
In-Reply-To: xUdB9.436993$DB1.4976953@news.easynews.com

Nelson,
You also asked what did the message mean.

In earlier releases of Apex it was usual to pass structured types by
reference, this meant
that the address of the actual data was passed to the called routine.  In
many instances
this was inefficient as temporary data had to be copied to memory, an
address to that
memory was then passed to the called routine which then used that address to
fetch
the data from memory.  The nett result was a number of data moves to/from
memory
that are wasteful of time.

In Apex 4.2 the compiler will recognise a class of data types (see the
release note for
details) that no longer need to be stored in memory, but will instead be
stored in machine
registers (probably where the values are already).  This way the called
subprogram doesn't
have to retrieve the data from memory.  This results in a significant time
saving.

Probably the best example would be a complex number type that is defined as
a record
with two floating point components.  With Apex 4.2 the components are passed
in
registers, which usually results in a significant speed up of applications
relying heavilly
upon these types.

The warning is there because it is possible that people have written code
that assumes
values of these types are passed as references and try to use them as such.
A good
example would be someone using packaing Machine_Code that accesses these
parameters.

Pragma Suppress_Warning can be used to supress the message.  Once again
refer to
the release note.

Greg Bek
Rational Software
"Hartmut Schaefer" <HSchaefer@rational.com> wrote in message
news:xUdB9.436993$DB1.4976953@news.easynews.com...
> Nelson,
>
> you can turn this warnings off  by the new "pragma suppress_warnings".
This
> pragma turns off the warning on a per type basis. There is no "global"
way,
> e.g. per view or per unit. I must admit that this might be laboringly.
>
> There are also 2 implementation defined parameters of pragma Convention
> dealing with the method how parameters are passed: Ada_Pass_By_Copy and
> Ada_Pass_By_Reference.
>
> Please have a look into the 4.2 release notes for a detailed description
of
> these new features. If you have further questions or comments don't
hesitate
> to contact our support.
>
>   Hartmut Schaefer
>     Rational Software Germany
>
> dealing with the pass method of parameters: pragma
> "Nelson Chandler" <nelson.c.chandler@boeing.com> schrieb im Newsbeitrag
> news:H4IBt8.KM5@news.boeing.com...
> > Hi.  I'm using Apex 4.2. When I compile and it reaches a record type, I
> get
> > this warning:
> >
> > "<record name> is passed by copy, but it was passed by reference in
> releases
> > prior to Apex 4.2; this may cause incompatibilities"
> >
> > What does this mean and why is it telling me.  It seems like record
types
> > would be fairly common and its extreemly annoying getting this message
all
> > the time.
> >
> > Thanks,
> > Nelson
> >
> >
>
>





      reply	other threads:[~2002-11-17 23:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-24 22:29 Apex 4.2 question about records Nelson Chandler
2002-10-25  2:30 ` Steven Deller
2002-11-15 21:43 ` Hartmut Schaefer
2002-11-17 23:04   ` Greg Bek [this message]
replies disabled

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