home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 103 / af103b.adf / ARexx / support.rexx < prev    next >
OS/2 REXX Batch file  |  1997-08-27  |  740b  |  41 lines

  1. /* support.rexx - a low-level memory allocation test */
  2.  
  3. MEMF_CLEAR = '00010000'x 
  4. MEMF_CHIP  = '00000002'x 
  5.  
  6. SIZE=100000 /* memory size to allocate (arbitary amount) */
  7.  
  8. signal on break_c /* cause a branch to my script's own control-c handling routine */
  9.  
  10. if ~Show('L','rexxsupport.library') then 
  11.     
  12.     call AddLib('rexxsupport.library',0,-30,0)
  13.     
  14. memory=AllocMem(SIZE,BITOR(MEMF_CLEAR,MEMF_CHIP))
  15.  
  16. say SIZE 'bytes of zero''d chip mem allocated. Now try hitting control-C!'
  17.  
  18. /* now do a delay loop which user can break into... */
  19.  
  20. do i=1 to 40000 
  21. end
  22.  
  23. FreeMem(memory,SIZE)
  24.  
  25. quit:
  26.  
  27. say 'Bye...'
  28.  
  29. exit /* end of program */
  30.  
  31.  
  32. break_c: 
  33.  
  34. say 'user hit control-c so release memory before quitting' 
  35.  
  36. FreeMem(memory,SIZE)
  37.  
  38. signal quit
  39.  
  40.  
  41.