home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 1036.dms / 1036.adf / PrtDriver / flush.c < prev    next >
C/C++ Source or Header  |  1977-12-31  |  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.