home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / ALLOC.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  2KB  |  106 lines

  1. /*  alloc.h
  2.  
  3.     memory management functions and variables.
  4.  
  5. */
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 1.5
  9.  *
  10.  *      Copyright (c) 1987, 1994 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. #if !defined(__ALLOC_H)
  16. #define __ALLOC_H
  17.  
  18. #if !defined(___DEFS_H)
  19. #include <_defs.h>
  20. #endif
  21.  
  22. #ifndef NULL
  23. #include <_null.h>
  24. #endif
  25.  
  26.  
  27. #if !defined(RC_INVOKED)
  28.  
  29. #if defined(__STDC__)
  30. #pragma warn -nak
  31. #endif
  32.  
  33. #endif  /* !RC_INVOKED */
  34.  
  35.  
  36.  
  37.  
  38. #ifndef _STDDEF
  39. #  define _STDDEF
  40. #  ifndef _PTRDIFF_T
  41. #    define _PTRDIFF_T
  42.      typedef int ptrdiff_t;
  43. #  endif
  44. #  ifndef _SIZE_T
  45. #    define _SIZE_T
  46.      typedef unsigned size_t;
  47. #  endif
  48. #endif
  49.  
  50. #if !defined(__STDC__)
  51. struct heapinfo
  52. {
  53.   void *    ptr;
  54.   unsigned  size;
  55.   int       in_use;
  56. };
  57. #endif
  58.  
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62.  
  63. void *_RTLENTRY _EXPFUNC calloc  (size_t __nitems, size_t __size);
  64. void  _RTLENTRY _EXPFUNC free    (void * __block);
  65. void *_RTLENTRY _EXPFUNC malloc  (size_t  __size);
  66. void *_RTLENTRY _EXPFUNC realloc (void * __block, size_t __size);
  67.  
  68. int   _RTLENTRY _EXPFUNC heapcheck    (void);
  69. int   _RTLENTRY _EXPFUNC heapfillfree (unsigned int __fillvalue);
  70. int   _RTLENTRY _EXPFUNC heapcheckfree(unsigned int __fillvalue);
  71. int   _RTLENTRY _EXPFUNC heapchecknode(void *__node);
  72. int   _RTLENTRY _EXPFUNC heapwalk     (struct heapinfo *__hi);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76.  
  77. /* Values returned by heap??? and _heap??? functions */
  78.  
  79. #define _HEAPEMPTY      1
  80. #define _HEAPOK         2
  81. #define _FREEENTRY      3
  82. #define _USEDENTRY      4
  83. #define _HEAPEND        5
  84. #define _HEAPCORRUPT    -1
  85. #define _BADNODE        -2
  86. #define _BADVALUE       -3
  87. #define _HEAPBADBEGIN   -4
  88. #define _HEAPBADNODE    -5
  89. #define _HEAPBADPTR     -6
  90.  
  91.  
  92.  
  93.  
  94. #if !defined(RC_INVOKED)
  95.  
  96. #if defined(__STDC__)
  97. #pragma warn .nak
  98. #endif
  99.  
  100. #endif  /* !RC_INVOKED */
  101.  
  102.  
  103. #endif  /* __ALLOC_H */
  104.  
  105.  
  106.