comp.lang.ada
 help / color / mirror / Atom feed
From: "Vladimir Olensky" <vladimir_olensky@yahoo.com>
Subject: Re: Which is right here - GNAT or OA ?
Date: 1999/05/31
Date: 1999-05-31T00:00:00+00:00	[thread overview]
Message-ID: <928174549.336.98@news.remarQ.com> (raw)
In-Reply-To: m33e0el4vr.fsf@deneb.cygnus.stuttgart.netsurf.de

Florian Weimer wrote in message ...
>"Vladimir Olensky" <vladimir_olensky@yahoo.com> writes:
>
>I don't think the language designers could have specified anything
>but erroneous execution in this case.  For example, it is very
>complicated to detect that the value of an Access attribute of an
>aliased record component is not a valid argument for a given instance
>of Ada.Unchecked_Deallocation if the record itself has been created by
>an allocator.  Simple heuristics based on the machine address of the
>object in question clearly do not work here.


As a matter of fact this is amazingly simple. If I can do this check at a
run time myself  why RTS can not do the same ?
The cost of this is one  additional  hidden field in the type
representation which  is set to needed value during object creation.
 Soon I demonstrate this simple technique in set of "talking" examples that
are almost ready to be posted to AdaPower.
The same thing could be done by the compiler itself.  There even will be no
need to have additional public run time attributes.
Compiler or allocator sets  this field during object creation and  RTS can
check this field and do what needed depending on value of this  field upon
object deallocation request. This could be very handy.

>
>Another but related thing surprises me---it's AARM 12.5.4(4.a):
>
>| If no _modifier applies to the formal, then the actual type may be
>| either a pool-specific or a general access-to-variable type.
>
>I can't imagine any reason why an access-to-variable type should be
>allowed as an actual parameter for a formal access type without an
>`all' modifier.  If this was changed, an access-to-variable would not be
>allowed as a parameter in an instantiation of Ada.Unchecked_Deallocation,
>which seems quite reasonable to me.  (I don't claim that the language
>definition inadequate here, I simply can't make sense out of it, which
>is very likely my own fault. ;)

Yes, very interesting,  I agree, it does not go all along the line with Ada
strong type checking.
In some circumstances it may cause the same result that was demonstrated in
my small demo.

Regards,

Vladimir Olensky








  reply	other threads:[~1999-05-31  0:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-30  0:00 Which is right here - GNAT or OA ? Vladimir Olensky
1999-05-30  0:00 ` Florian Weimer
1999-05-31  0:00   ` Vladimir Olensky [this message]
1999-05-31  0:00     ` Robert Dewar
1999-06-05  0:00       ` Vladimir Olensky
1999-06-05  0:00         ` Florian Weimer
1999-06-05  0:00         ` Vladimir Olensky
1999-06-05  0:00           ` Robert Dewar
1999-06-07  0:00             ` Ada safety road Was: Which is right Vladimir Olensky
1999-06-06  0:00               ` Robert Dewar
1999-06-07  0:00                 ` Pascal F. Martin
1999-06-07  0:00                   ` Vladimir Olensky
1999-06-08  0:00                 ` Robert A Duff
1999-06-06  0:00               ` Larry Kilgallen
1999-06-07  0:00                 ` Keith Thompson
1999-06-07  0:00                   ` Hyman Rosen
1999-06-08  0:00                     ` Robert A Duff
1999-06-08  0:00                       ` Robert Dewar
1999-06-08  0:00                       ` Keith Thompson
1999-06-09  0:00                         ` Robert Dewar
1999-06-09  0:00                           ` Tucker Taft
1999-06-09  0:00                             ` Robert Dewar
1999-06-09  0:00                         ` dennison
1999-06-09  0:00                           ` Entamology of "Nasal Demons" dennison
1999-06-09  0:00                       ` Ada safety road Was: Which is right dennison
1999-06-08  0:00                   ` Robert Dewar
1999-06-07  0:00                     ` Keith Thompson
1999-06-08  0:00                     ` Robert A Duff
1999-06-08  0:00                   ` Robert A Duff
1999-06-14  0:00                   ` Ada safety road Franco Mazzanti
1999-06-15  0:00                     ` Franco Mazzanti
1999-06-16  0:00                       ` Vladimir Olensky
1999-06-10  0:00               ` Ada safety road Was: Which is right Peter Amey
1999-06-10  0:00                 ` Markus Kuhn
1999-06-11  0:00                   ` Vladimir Olensky
1999-06-12  0:00                     ` Robert Dewar
1999-06-12  0:00                       ` JP Thornley
1999-06-13  0:00                         ` Vladimir Olensky
1999-06-16  0:00                         ` William Dale
1999-06-19  0:00                           ` JP Thornley
1999-06-21  0:00                           ` Robert A Duff
1999-06-13  0:00                       ` Vladimir Olensky
1999-06-12  0:00                         ` Matthew Heaney
1999-06-13  0:00                           ` Vladimir Olensky
1999-06-13  0:00                         ` Robert Dewar
1999-06-13  0:00                           ` Vladimir Olensky
1999-06-13  0:00                         ` Robert Dewar
1999-06-13  0:00                           ` swhalen
1999-06-13  0:00                           ` Vladimir Olensky
1999-06-01  0:00   ` Which is right here - GNAT or OA ? Tucker Taft
1999-05-30  0:00 ` Robert Dewar
1999-05-31  0:00   ` Vladimir Olensky
1999-05-31  0:00     ` Robert Dewar
1999-06-01  0:00   ` dennison
1999-05-31  0:00 ` David Botton
1999-06-01  0:00   ` dennison
1999-06-03  0:00 ` Matthew 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