home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 223_01 / avail.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-12-31  |  640 b   |  20 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. /*
  3. ** Return the number of bytes of available memory.
  4. ** In case of a stack overflow condition, if 'abort'
  5. ** is non-zero the program aborts with an 'S' clue,
  6. ** otherwise zero is returned.
  7. */
  8.  
  9. external char *zzmem
  10.  
  11. avail(aburt) int aburt; {
  12.   char x;
  13.   if(&x < zzmem) {
  14.     if(aburt) abort('M');
  15.     return (0);
  16.     }
  17.   return (&x - zzmem);
  18.   }
  19.  
  20.