comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Beware: Rep spec on an enumeration type causes code explosion
Date: 1997/12/06
Date: 1997-12-06T00:00:00+00:00	[thread overview]
Message-ID: <EKrsrr.LD7.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: gwinn-0512972303070001@dh5055063.res.ray.com


Joe Gwinn (gwinn@res.ray.com) wrote:

: ...
: Exception handlers.  We were declaring a number of exception handlers at
: the beginning of each and every module, so every time the module was
: entered, the context had to be saved, and every time the module was
: exited, the context was popped off the exception stack and discarded,
: regardless of if an exception was ever raised.  This was easily solved;
: now, only tasks declare exception handlers, not modules.

I believe Green Hills is beginning to work on an implementation of
exceptions that uses a PC-indexed table rather than setjmp/longjmp.  
However, as Robert points out, using such a table is significantly more
machine-dependent, and generally requires coordination with the linker
and more complex out-of-line algorithms in the run-time.

As far as enumeration types, as others have pointed out, the Ada 95
standard requires that the internal codes for enumeration types are
contiguous and start at zero, so you are not in any danger if you leave
out your "confirming" representation clauses.  It would be nice if
our front end recognized "confirming" enumeration representation 
clauses, but as usual, there are many possible "optimizations" 
and this one never made it to the top of the list.
One might argue that this is not really an optimization, but 
it does require special code to recognize, and so represents
yet another "special case" that you have to decide the priority
of recognizing.

: ...
: Memory Management.  The Ada Runtime System makes extensive calls to the C
: functions malloc() and free(), a cause for worry.  

It might be interesting to identify where this is really happening.
Were these from calls in your source code to "new" and instances
of Unchecked_Deallocation, or were they "implicit"?

We have versions of our runtime which only use the heap "implicitly" 
for task control blocks (and these are recycled explicitly rather than 
using free) and for task stacks (and again, these are recycled rather
than using free).  So the only calls on "free" should be in response
to an explicit call on an instance of unchecked-deallocation.  Furthermore,
we also have our own implementation of malloc/free which uses 
"quick fit" rather than the traditional C "first fit."  This may
be the algorithm

: ...
: Joe Gwinn

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  parent reply	other threads:[~1997-12-06  0:00 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-05  0:00 Beware: Rep spec on an enumeration type causes code explosion Joe Gwinn
1997-12-06  0:00 ` Robert Dewar
1997-12-06  0:00 ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-06  0:00 ` David Marshall
1997-12-06  0:00 ` Kevin D. Heatwole
     [not found]   ` <dewar.881478386@merv>
1997-12-07  0:00     ` Robert Dewar
1997-12-09  0:00   ` Jim Gleason
1997-12-06  0:00 ` Tucker Taft [this message]
1997-12-06  0:00   ` Robert Dewar
1997-12-06  0:00   ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-08  0:00     ` Mats Weber
1997-12-09  0:00     ` Tucker Taft
1997-12-09  0:00       ` Matthew Heaney
1997-12-10  0:00         ` Charles Hixson
1997-12-10  0:00       ` Stanley R. Allen
1997-12-14  0:00         ` Robert Dewar
1997-12-10  0:00       ` Stephen Leake
1997-12-14  0:00         ` Robert Dewar
1997-12-10  0:00       ` Ken Garlington
1997-12-11  0:00         ` John G. Volan
1997-12-11  0:00           ` Ken Garlington
1997-12-12  0:00             ` Matthew Heaney
1997-12-12  0:00               ` Ken Garlington
1997-12-16  0:00                 ` John G. Volan
1997-12-17  0:00                   ` Ken Garlington
1997-12-12  0:00           ` Joe Gwinn
1997-12-12  0:00             ` Robert Dewar
1997-12-16  0:00             ` John G. Volan
1997-12-17  0:00               ` Joe Gwinn
1997-12-17  0:00                 ` John G. Volan
1997-12-18  0:00                   ` Joe Gwinn
1997-12-17  0:00               ` Ken Garlington
1997-12-12  0:00           ` Alan E & Carmel J Brain
1997-12-12  0:00             ` Robert Dewar
1997-12-15  0:00               ` Tucker Taft
1997-12-16  0:00                 ` Brian Rogoff
1997-12-10  0:00       ` Jean-Pierre Rosen
1997-12-10  0:00       ` Robert Dewar
1997-12-11  0:00       ` Rakesh Malhotra
1997-12-11  0:00         ` Matthew Heaney
1997-12-12  0:00           ` Robert Dewar
1997-12-12  0:00           ` Rakesh Malhotra
1997-12-12  0:00           ` Samuel Tardieu
1997-12-12  0:00             ` Robert Dewar
1997-12-14  0:00         ` Alan E & Carmel J Brain
1997-12-12  0:00       ` Joe Gwinn
1997-12-15  0:00         ` Robert Dewar
1997-12-16  0:00           ` Joe Gwinn
1997-12-16  0:00             ` Robert Dewar
1997-12-09  0:00     ` Geert Bosch
1997-12-10  0:00       ` Robert Dewar
1997-12-06  0:00 ` Robert Dewar
1997-12-06  0:00   ` Matthew Heaney
1997-12-10  0:00   ` GNORT information ( Was Re: Beware: Rep spec on an enumeration type causes code explosion ) Mark Bennison
1997-12-10  0:00     ` Robert Dewar
1997-12-06  0:00 ` Beware: Rep spec on an enumeration type causes code explosion Corey Minyard
1997-12-08  0:00   ` Joe Gwinn
1997-12-10  0:00     ` Robert Dewar
1997-12-06  0:00 ` Ken Garlington
1997-12-06  0:00 ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-09  0:00     ` Stanley R. Allen
1997-12-06  0:00 ` Robert Dewar
1997-12-07  0:00 ` Larry Kilgallen
  -- strict thread matches above, loose matches on Subject: below --
1997-12-09  0:00 tmoran
1997-12-11  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-12-11  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-12-11  0:00 ` Robert Dewar
replies disabled

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