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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: Fri, 24 Apr 1992 16:47:01 PDT From: rlk@VisiCom.COM Subject: Re: 'image and memory allocation Message-ID: <9204242347.AA00366@amstel.VisiCom.COM> List-Id: pete@bloom-beacon.mit.edu writes: > >Any Ada program which allocates dynamic memory in a tight loop will eventual ly > >crash. The solution however is simply to leave the frame of reference at > >least once per loop. This can be done by putting a BEGIN ... END around the > >statement that allocates the memory, or by putting it inside a function > >call. > > I'll try that. However, this is a trick that someone using only the LRM > for a reference would never come up with. A reassignment to the same > pointer (oops, access variable) should be able to automatically do the > same thing (though I don't know if even PL/I did that) in order for a > naive programmer writing a simple DP-type program to make it work easily. > I'm thinking here of a typical "fast" program that you would write in > an hour or less (e.g. five minutes) in AWK. Naive programmers should not be writing programs in one hour that are expected to run forever, no? This is one of those areas that code inspections and code reviews add value to the software engineering process. > Note that often simple DP progs have a single loop at the top level, > and SHOULD work on extensible data sets. The trick you give is simply > that, a trick, and shouldn't be necessary (besides, NO manual documents > it. Of course, if your manual doesn't document where dynamic memory is used, then it's got a problem. I don't think that it should be up to the Ada Reference Manual to document such implementation-dependent issues. IMHO, of course. .Bob.