Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: rexxarplib Message-ID: <12550@cbmvax.commodore.com> Date: 11 Jun 90 19:55:24 GMT References: <1674@lpami.wimsey.bc.ca> <839@rulcvx.LeidenUniv.nl> Reply-To: jesup@cbmvax (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 29 In article <839@rulcvx.LeidenUniv.nl> aips@rulcvx.LeidenUniv.nl (W. Jaffe) writes: >I have an interesting problem. I wonder if it has any value >to check whether an AllocMem of 1Kb fails. >In my opinion it is an absolute waste of time and space to do >such a check, because the system would have crashed long before >only 1Kb was left. Intuition don't like a low memory environment. It has great value. Checking for allocation failure means you can recover or at least fail gracefully instead of crashing the machine, and perhaps losing the user's work in another program. ALL allocations can fail, and it doesn't mean the system is dead (though it may not be able to do things like move windows until memory gets freed). Sometimes lack of memory is very temporary, due to a large allocation that is freed quickly, or if your program or some other program notices a failure, and backs out of an operation, freeing up memory it had already allocated. This is known as good programming practice. >Also, it is absolute nonsense to check an OpenLibrary(graphics.library) >call. If it is not there, you can better go to a repair shop. You have a better point here, though if you supply a version other than 0 you need to check the result. -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com BIX: rjesup Common phrase heard at Amiga Devcon '89: "It's in there!"