Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!pollux.usc.edu!papa From: papa@pollux.usc.edu (Marco Papa) Newsgroups: comp.sys.amiga.tech Subject: Re: Flushing handlers out of memory. Message-ID: <18551@usc.edu> Date: 16 Jul 89 01:03:02 GMT References: <59256@linus.UUCP> Sender: news@usc.edu Reply-To: papa@pollux.usc.edu (Marco Papa) Organization: Felsina Software, Los Angeles, CA Lines: 41 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. This >can happen very often when I'm chasing down a bug by adding debug messages. >In his example ram disk handler, Matt Dillon's solution to flushing out the >handler was a program to allocate all the memory, hoping to cause exec to >flush it. In a POSTTER file, he said that may not work after all and suggested >using multiple mountlist entries. Matt's solution worked for me. I am developing XPR-based external protocol libraries. When I make a change after I run the external protocol library, I select another protocol (which produces a CloseLibrary, and the use count goes to zero). Then I run FlushAll (see later). I check with Xoper's lib command that the library is flushed and then test the new library after having it copied to LIBS:. I know the same works for devices and I see no reason why it shouldn't work for handlers. Here is the stupid code for that: #include "stdio.h" #include "exec/types.h" #include "functions.h" main() { char *ptr; ptr = (char *) AllocMem(16000000L, 0L); /* cause the expunge */ if (ptr != NULL) FreeMem(ptr, 16000000L); } 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 :-) I was doing that in A-Talk III (yes, I repent :-). The next version will use the newly-"recommended" way of expunging the serial device "by name" (see Bryce Nesbitt example in AmigaMail). -- Marco Papa 'Doc' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= uucp:...!pollux!papa BIX:papa ARPAnet:pollux!papa@oberon.usc.edu "There's Alpha, Beta, Gamma, Diga and Caligari!" -- Rick Unland -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=