Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!oliveb!amiga!jimm From: jimm@amiga.UUCP (Jim Mackraz) Newsgroups: comp.sys.amiga.tech Subject: Re: Flushing handlers out of memory. Message-ID: <4118@amiga.UUCP> Date: 16 Jul 89 19:15:04 GMT References: <59256@linus.UUCP> <18551@usc.edu> Reply-To: jimm@cloyd.UUCP (Jim Mackraz) Organization: Commodore-Amiga Inc, Los Gatos CA Lines: 36 In article <18551@usc.edu> papa@pollux.usc.edu (Marco Papa) writes: )In article <59256@linus.UUCP> rachamp@mbunix.mitre.org (Champeaux) writes: )>While writing PLT:, I've found myself rebooting the computer every time )>I make a change so that the new version will be loaded into memory. ){ ) char *ptr; ) ) ptr = (char *) AllocMem(16000000L, 0L); /* cause the expunge */ ) if (ptr != NULL) FreeMem(ptr, 16000000L); )} In commodities.library I just rigged it so that when the OpenCnt goes to zero, I expunge myself. Now, how do I do that? I guess I'll have to check. Anyway, that means that while testing I can easily assure that I'm getting a new copy off the disk. Depending on the expected use of a library, leaving such code in by mistake isn't that bad. Commodities.library is used for "TSR" style programs: once open, it typically will not ever see OpenCnt == 0. )Note that this code should NOT be included at the end of a program to force )a "global" expunge to satisfy all the reviewers that run AvailMem to check )if a program frees all the resources it has allocated. Jimm will hang you for )that :-) No, I'll scold them. It's *you* I'll hang for posting this code fragment ;^) ;^) ;^) )-- Marco Papa 'Doc' jimm -- Jim Mackraz, I and I Computing "... the signs are very ominous, {cbmvax,well,oliveb}!amiga!jimm and a chill wind blows." - Justice Blackmun Opinions are my own. Comments are not to be taken as Commodore official policy.