comp.lang.ada
 help / color / mirror / Atom feed
From: rlk@VisiCom.COM
Subject: Re: 'image and memory allocation
Date: Fri, 24 Apr 1992 16:47:01 PDT	[thread overview]
Message-ID: <9204242347.AA00366@amstel.VisiCom.COM> (raw)

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.

             reply	other threads:[~1992-04-24 23:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-04-24 23:47 rlk [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-04-24 13:33 'image and memory allocation Bill Yow
1992-04-23 16:43 dog.ee.lbl.gov!overload.lbl.gov!agate!spool.mu.edu!mips!sdd.hp.com!elroy.
replies disabled

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