From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Storage_Size in a Simple Program Date: Wed, 24 Oct 2018 23:51:08 +0300 Organization: Tidorum Ltd Message-ID: References: <1nx0yp3.x6ss3k18nq71lN%csampson@inetworld.net> <1nx5k9a.1n8zqjs1xf0pe6N%csampson@inetworld.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net NPBwfV6kCVg77omKMlwtqQjIM45rFJ6KLpBG8GOZQ4vIVhCVQU Cancel-Lock: sha1:veUQFap0qyVlMyF+a2Gr6TEaWuk= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <1nx5k9a.1n8zqjs1xf0pe6N%csampson@inetworld.net> Xref: reader02.eternal-september.org comp.lang.ada:54703 Date: 2018-10-24T23:51:08+03:00 List-Id: On 18-10-24 12:07 , Charles H. Sampson wrote: > Charles H. Sampson wrote: > >> I've got a conceptually simple program that uses a lot of memory. It is >> highly recursive (using a lot of stack) and also puts a lot of stuff on >> the heap. Is there any way to specify that a lot of memory is needed >> other than pragma Storage_Size? >> >> As it is, I have three totally artificial tasks hidden in packages. The >> packages' entry routines are simply pass-throughs to their embedded >> task's entries. There are no concurrency issues because the simple >> program is single-threaded at heart. >> >> Is that it? That's a lot of baggage just to give permission to use more >> memory, particularly when there's a lot of memory lying around now. > > All the responses about limit/ulimit are certainly solutions, but > they're not quite what I was asking about. I was looking for a solution > written in Ada. I've been around Ada long enough to remember that a goal > was to be able to completely express programs in Ada itself without > having to worry about outside influences. (I write this knowing that the > semantics of pragma Storage_Size are not at all tight.) If you need a big stack: - All Ada compilers I have used have had some way of defining the size of the stack for the environment task. But usually not by pragma Storage_Size, unfortunately. - If you don't want to use the compiler-specific method to size the environment task stack, put all of the code into one task, with a large Storage_Size. - If that doesn't work, because your shell or O/S doesn't let you have such a large stack, use limit/ulimit to tell the shell or O/S what you need. - If you don't want to use limit/ulimit, and the stack is still too small, you are trying to run the program on a "machine" with too little memory resources, and no language can help. That said, I would welcome a standard Ada way to specify the stack size for the environment task. Perhaps Storage_Size could be specified for the main subprogram, in the same way as the Priority for the environment task. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .