home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / CMTEX330 / SOURCE / ALLOC.H < prev    next >
C/C++ Source or Header  |  1992-02-19  |  811b  |  45 lines

  1.  
  2. /*
  3.  * %Y%:%M%:%I%:%Q%
  4.  *
  5.  * Copyright 1987,1988,1991 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  *
  11.  */
  12.  
  13. #define null 0
  14.  
  15. global    ptr    avail;
  16.  
  17. ptr    new_avail();
  18.  
  19. #ifdef STAT
  20. #define fast_new_avail(M) \
  21.     {M = avail; if (M == NULL) M = new_avail(); \
  22.     else {avail = link(M); link(M) = NULL; incr(dyn_used);}}
  23. #define free_avail(M) \
  24.     {link(M) = avail; avail = M; decr(dyn_used);}
  25. #else
  26. #define fast_new_avail(M) \
  27.     {M = avail; if (M == NULL) M = new_avail(); \
  28.     else {avail = link(M); link(M) = NULL;}}
  29. #define free_avail(M) \
  30.     {link(M) = avail; avail = M;}
  31. #endif
  32.  
  33. global    ptr    rover;
  34.  
  35. ptr    new_node();
  36. void    free_node();
  37.  
  38. #ifdef STAT
  39. global    int    dyn_used;
  40. global    int    var_used;
  41. #endif
  42.  
  43. void    _alloc_init();
  44. void    _alloc_init_once();
  45.