home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 295.lha / Clean_v1.01 / Clean.MOD < prev    next >
Text File  |  1980-11-11  |  3KB  |  57 lines

  1. MODULE Clean;
  2.  
  3. (*=========================================================================*)
  4. (*                Clean - Written in M2Sprint FROM M2S Ltd.                *)
  5. (*=========================================================================*)
  6. (*          Copyright (c) 1989 Chris Everett, All Rights Reserved          *)
  7. (*                    This is freely redistributable                       *)
  8. (*=========================================================================*)
  9. (*             Version: 1.01          Author : Chris Everett               *)
  10. (*             Date   : 21-Sep-89     Changes: Recompiled w/V1.12 M2Sprint *)
  11. (*=========================================================================*)
  12. (*                                                                         *)
  13. (*  De-fragments RAM by requesting a rediculous amount of memory.  The     *)
  14. (*  system can't get that much (16MB), so it flushes all libraries and     *)
  15. (*  tries again.  The process of flushing all open libraries usually will  *)
  16. (*  de-fragment RAM.                                                       *)
  17. (*                                                                         *)
  18. (*  This version does something a bit different from Sweep and all the     *)
  19. (*  others - it first closes the Workbench screen, then tries to allocate  *)
  20. (*  16MB of both Fast and Chip RAM, then re-opens the Workbench screen.    *)
  21. (*  This seems to do a much better job of de-fragmenting Chip RAM.         *)
  22. (*                                                                        *)
  23. (*  For example, use Avail to check on the status of Chip RAM, then run    *)
  24. (*  DeluxePaint III.  Exit from DPaint, then run Avail again.  There       *)
  25. (*  should be a much smaller contigous amount of Chip RAM available.       *)
  26. (*  Using Sweep doesn't affect this at all, but Clean completely restores  *)
  27. (*  Chip RAM to it's original state.                                       *)
  28. (*                                                                         *)
  29. (* E-Mail:       Questions, comments, etc. may be E-Mailed to me on the    *)
  30. (*               LightSpeed BBS @ (503) 777-1252, or the NAG BBS @         *)
  31. (*               (503) 656-7393. (Both are PC-Pursuitable.)                *)
  32. (*                                                                         *)
  33. (*=========================================================================*)
  34. (*                          Link with RTnoWB.lnk                           *)
  35. (*=========================================================================*)
  36.  
  37. (*ALL_CHECKS-*)
  38.  
  39. FROM SYSTEM IMPORT ADDRESS;
  40. FROM Memory IMPORT AllocMem, MemReqSet, MemChip, MemFast;
  41. FROM Intuition IMPORT CloseWorkBench, OpenWorkBench;
  42.  
  43.  
  44. VAR
  45.  
  46.     Adr    :    ADDRESS;
  47.     temp    :    BOOLEAN;
  48.  
  49. BEGIN
  50.  
  51.     temp := CloseWorkBench();
  52.     Adr := AllocMem(1000000H,MemReqSet{MemFast});
  53.     Adr := AllocMem(1000000H,MemReqSet{MemChip});
  54.     temp := OpenWorkBench();
  55.  
  56. END Clean.
  57.