home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!hal.com!darkstar.UCSC.EDU!cats.ucsc.edu!davids
- From: davids@cats.ucsc.edu (Dave Schreiber)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Flushing unused devices out of ram , how ?
- Message-ID: <1j09toINNn6s@darkstar.UCSC.EDU>
- Date: 13 Jan 93 05:39:04 GMT
- References: <amipb.067x@amipb.gna.org>
- Organization: University of California; Santa Cruz
- Lines: 26
- NNTP-Posting-Host: as215-ws-18.ucsc.edu
-
-
- In article <amipb.067x@amipb.gna.org> amipb@amipb.gna.org (Philippe Berard) writes:
- >In article <1993Jan6.104949.20894@philips.oz.au> gduncan@philips.oz.au (Gary Duncan) writes:
- >> Currently in a C-program I've done a :-
- >> Execute ("Avail Flush >nil:", 0,0);
- >>
- >> which does the job but its a bit klugey.
- >>
- >> Why do I want to do this? Simply that if you open a device (for
- >> the first time ) then close it, it hangs around unused in RAM
- >> giving the impression of a memory leak.
- >
- > You must use an AllocMem(-1, MEMF_PUBLIC), this will flush all libraries
- > and devices with an OpenCount set to 0.
-
- You probably don't want to do the above, since AllocMem rounds memory sizes
- up to a value evenly divisible by 8. -1 (0xFFFFFFFF) rounded up to a value
- divisible by 8 is 0, which won't flush anything. Try a size of -8, or
- -65536 (in case Commodore should someday increase the 'chunkiness' of
- memory allocations).
-
- >| Philippe Berard (French Amiga User) | |
- >| "They hold a cup of wisdom, | UseNet : amipb@amipb.gna.org |
-
- --
- Dave Schreiber "Look. Don't touch." davids@cats.ucsc.edu (until 6/20/93)
-