home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prt_util / prtdrivr.lzh / PRTDRIVER / FLUSH.C < prev    next >
C/C++ Source or Header  |  1991-08-16  |  327b  |  21 lines

  1. #include <exec/memory.h>
  2.  
  3. /*
  4.  *  Allocate memory until we can't ... force the system to flush all
  5.  *  non-active DOS devices, libraries, fonts, etc....
  6.  */
  7.  
  8. extern void *AllocMem();
  9.  
  10. main()
  11. {
  12.     char *ptr;
  13.     long bytes = 1 << 9;
  14.  
  15.     while (ptr = AllocMem(bytes, MEMF_PUBLIC)) {
  16.     FreeMem(ptr, bytes);
  17.     bytes <<= 1;
  18.     }
  19. }
  20.  
  21.