home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / alloc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  2.5 KB  |  122 lines

  1. /*  alloc.h
  2.  
  3.     memory management functions and variables.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 10.0
  9.  *
  10.  *      Copyright (c) 1987, 2000 by Inprise Corporation
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. /* $Revision:   9.3  $ */
  16.  
  17. #if !defined(__ALLOC_H)
  18. #define __ALLOC_H
  19.  
  20. #ifndef ___STDDEF_H
  21. #include <_stddef.h>
  22. #endif
  23.  
  24. #if !defined(RC_INVOKED)
  25.  
  26. #if defined(__STDC__)
  27. #pragma warn -nak
  28. #endif
  29.  
  30. #endif  /* !RC_INVOKED */
  31.  
  32. #ifdef __cplusplus
  33. namespace std {
  34. #endif
  35.  
  36. #if !defined(__STDC__)
  37. struct heapinfo
  38. {
  39.   void *    ptr;
  40.   void *    ptr2;
  41.   unsigned  size;
  42.   int       in_use;
  43. };
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. void *   _RTLENTRY _EXPFUNC calloc(_SIZE_T __nitems, _SIZE_T __size);
  51. void     _RTLENTRY _EXPFUNC free(void * __block);
  52. void *   _RTLENTRY _EXPFUNC malloc(_SIZE_T  __size);
  53. void *   _RTLENTRY _EXPFUNC realloc(void * __block, _SIZE_T __size);
  54. int      _RTLENTRY _EXPFUNC heapcheck(void);
  55. int      _RTLENTRY _EXPFUNC heapfillfree(unsigned int __fillvalue);
  56. int      _RTLENTRY _EXPFUNC heapcheckfree(unsigned int __fillvalue);
  57. int      _RTLENTRY _EXPFUNC heapchecknode(void *__node);
  58. int      _RTLENTRY _EXPFUNC heapwalk(struct heapinfo *__hi);
  59.  
  60. #if defined(__DPMI32__)
  61. unsigned _RTLENTRY          coreleft(void);
  62. #endif
  63.  
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67.  
  68. /* Values returned by heap??? and _heap??? functions */
  69.  
  70. #define _HEAPEMPTY      1
  71. #define _HEAPOK         2
  72. #define _FREEENTRY      3
  73. #define _USEDENTRY      4
  74. #define _HEAPEND        5
  75. #define _HEAPCORRUPT    -1
  76. #define _BADNODE        -2
  77. #define _BADVALUE       -3
  78. #define _HEAPBADBEGIN   -4
  79. #define _HEAPBADNODE    -5
  80. #define _HEAPBADPTR     -6
  81.  
  82. #if !defined(__STDC__)
  83. #define farcalloc   calloc
  84. #define farcoreleft coreleft
  85. #define farfree     free
  86. #define farmalloc   malloc
  87. #define farrealloc  realloc
  88. #endif
  89.  
  90. #if !defined(RC_INVOKED)
  91.  
  92. #if defined(__STDC__)
  93. #pragma warn .nak
  94. #endif
  95.  
  96. #endif  /* !RC_INVOKED */
  97.  
  98. #ifdef __cplusplus
  99. } // std
  100. #endif
  101.  
  102. #endif  /* __ALLOC_H */
  103.  
  104.  
  105. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__ALLOC_H_USING_LIST)
  106. #define __ALLOC_H_USING_LIST
  107.     using std::calloc;
  108.     using std::free;
  109.     using std::malloc;
  110.     using std::realloc;
  111. #if !defined(__STDC__)
  112.     using std::heapinfo;
  113. #endif
  114.     using std::heapcheck;
  115.     using std::heapfillfree;
  116.     using std::heapcheckfree;
  117.     using std::heapchecknode;
  118.     using std::heapwalk;
  119. #   if defined(__DPMI32__)
  120.         using std::coreleft;
  121. #   endif
  122. #endif /* __USING_CNAME__ */