Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-pcd!hpcvca!charles From: charles@hpcvca.CV.HP.COM (Charles Brown) Newsgroups: comp.sys.amiga.tech Subject: Re: Memory Protection! Message-ID: <1410050@hpcvca.CV.HP.COM> Date: 21 Aug 90 18:27:33 GMT References: <1145.26bd4989@waikato.ac.nz> Organization: Hewlett-Packard Co., Corvallis, Oregon Lines: 29 >> Asking Amiga programmers to immediately stop putting data in code >> hunks is like asking Unix programmers to always free all their >> memory before exiting a program. > What's wrong with that? *I* always free all my memory before exiting a > program (well, I leave it up to "exit()" to free memory that stdio has > allocated) simply because I write re-usable routines: I expect that > they may be used in a program that *doesn't* exit on an error. Say, an > interactive one. > -- > Peter da Silva. `-_-' In Unix it is slower because the system can release all that memory much faster than you can. Thats because it releases all of it at once rather than releasing each separately malloc'ed portion. At least this is what I understand from what a friend told me. He knows much more about Unix than I do. The only reason I was concerned about this is because on the Amiga you *must* deallocate all that RAM because the system does not implement resource tracking. I mentioned to him that I intended to do this in all my code. He told me it was a bad idea for code which would be used on Unix. So now the best solution I know of is to place this within #ifdef's which include the deallocation only if the target machine is an Amiga. -- Charles Brown charles@cv.hp.com or charles%hpcvca@hplabs.hp.com or hplabs!hpcvca!charles or "Hey you!" Not representing my employer.