home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18598 < prev    next >
Encoding:
Internet Message Format  |  1993-01-13  |  1.6 KB

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