From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_20,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 21 Apr 92 15:44:14 GMT From: van-bc!wolfe.wimsey.bc.ca!rsoft!agate!spool.mu.edu!umn.edu!atc!email!park hill@ucbvax.Berkeley.EDU (parkhill) Subject: Re: Library Package Initialization (2nd try) Message-ID: <5987@email.sp.unisys.com> List-Id: 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