comp.lang.ada
 help / color / mirror / Atom feed
* Re: Library Package Initialization (2nd try)
@ 1992-04-21 15:44 van-bc!wolfe.wimsey.bc.ca!rsoft!agate!spool.mu.edu!umn.edu!atc!email!park
  0 siblings, 0 replies; only message in thread
From: van-bc!wolfe.wimsey.bc.ca!rsoft!agate!spool.mu.edu!umn.edu!atc!email!park @ 1992-04-21 15:44 UTC (permalink / raw)


sampson@cod.nosc.mil (Charles H. Sampson) writes:
> 
>      Sorry about that.  Apparently my news poster has an undocumented
> requirement for a blank line in a certain position.  What I intended to
> post was:
> 
>      The initialization code for a library package gets executed exactly
> once, when the package is elaborated before program execution begins.  A
> smart Ada system could take advantage of this by making the memory occu-
> pied by that code and the associated data available, say in the heap,
> during program execution.  Does anyone know what existing compilers do?
> 
>      This is not just an academic interest to me.  I'm considering some
> initialization code that might be prettly large and might have to run on
> a machine with limited memory.
> 
> 				Charlie

In Telesoft 1.4a (old) the data space used for initialization of library
packages was allocated in the permanent data storage for the package.
This really uses a lot of space when the package consists of strings that
are concatinated. The only justification I could find for this (Telesoft
did NOT say this) was that the amount of space required for elaboration
exceeded the maximum task stack size, so it couldn't execute in the data
area of the enviromental task.  The runtime was Ready Systems so the 
"Heap" had different characteristics than Telesofts normal implementation.
All the space of the "heap" had to be preallocated and the size of the
blocks was fixed.  Using the heap wouldn't save you anything so they just
put the elaboration "stack" for a package in with the package data.  This
consumed much too much space so we had to take out the initialization in
our packages and put in procedures to perform the initialization. Each 
procedure was coded such that its activation record would not exceed the
maximum stack size. Sometimes this required many separate calls.

I would not call this common, but in one package which had 20,000 bytes
worth of string constants we reduced the space from 120,000 bytes to
40,000. The space is 40,000 because you have the space to hold the
constant strings the objects which hold the concatinated values.

Robert Parkhill

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-04-21 15:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-04-21 15:44 Library Package Initialization (2nd try) van-bc!wolfe.wimsey.bc.ca!rsoft!agate!spool.mu.edu!umn.edu!atc!email!park

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