Path: utzoo!attcan!uunet!comp.vuw.ac.nz!dsiramd!actrix!templar!jbickers From: jbickers@templar.actrix.co.nz (John Bickers) Newsgroups: comp.sys.amiga.tech Subject: Re: rexxarplib Message-ID: <3669.tnews@templar.actrix.co.nz> Date: 11 Jun 90 22:11:56 GMT Followup-To: comp.sys.amiga.tech Organization: TAP, NZAmigaUG. Lines: 39 Quoted from - aips@rulcvx.LeidenUniv.nl (W. Jaffe): > 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. Yes (it has value). I have seen Intuition cope (sort of) with low RAM conditions - menus stop appearing, and the suchlike. I think the worst offender guru-wise is loading a program and running out of RAM before the load is complete, isn't it? Early on, I read someone from... Aegis... say that they allocated a "rip-cord" chunk of RAM in order to be able to inform the user RAM was out should this happen later. It was in an interview in CBM's magazine. Seems like a good idea, if you can't just print an error to the command line, or even terminate silently. > 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. I wouldn't say its *absolute* nonsense, though there are reasons for not bothering to check. However, if you care about what revision of the graphics library is present (one way to check for which KS you're running under?) you'll want to check. You'll also want to check in case some other piece of software has crapped out that library somehow. In the early stages of writing the code, you might also want to check just to catch spelling errors. Plus it's just general defensive programming, along the lines of why people bother to check for errors at all, or why some people use <=, >=, etc comparison operators instead of just == in loops. Etc. > Greetings from Raymond and Erwin. -- *** John Bickers, TAP, NZAmigaUG. jbickers@templar.actrix.co.nz *** *** Let them figure it out, Come on and step across, *** *** Just remind yourself, We are here to code. - munged Devo ***