Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.0 KiB

  1. /***
  2. *malloc.h - declarations and definitions for memory allocation functions
  3. *
  4. * Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Contains the function declarations for memory allocation functions;
  8. * also defines manifest constants and types used by the heap routines.
  9. * [System V]
  10. *
  11. *******************************************************************************/
  12. #define _HEAPEMPTY -1
  13. #define _HEAPOK -2
  14. #define _HEAPBADBEGIN -3
  15. #define _HEAPBADNODE -4
  16. #define _HEAPEND -5
  17. #define _HEAPBADPTR -6
  18. #define _FREEENTRY 0
  19. #define _USEDENTRY 1
  20. #ifndef _SIZE_T_DEFINED
  21. typedef unsigned int size_t;
  22. #define _SIZE_T_DEFINED
  23. #endif
  24. #if (!defined(NO_EXT_KEYS))
  25. #ifndef _HEAPINFO_DEFINED
  26. typedef struct _heapinfo {
  27. int far * _pentry;
  28. size_t _size;
  29. int _useflag;
  30. } _HEAPINFO;
  31. #define _HEAPINFO_DEFINED
  32. #endif
  33. #else /* NO_EXT_KEYS */
  34. #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
  35. #ifndef _HEAPINFO_DEFINED
  36. typedef struct _heapinfo {
  37. int * _pentry;
  38. size_t _size;
  39. int _useflag;
  40. } _HEAPINFO;
  41. #define _HEAPINFO_DEFINED
  42. #endif
  43. #endif /* M_I86CM || M_I86LM || M_I86HM */
  44. #endif /* NO_EXT_KEYS */
  45. #if (defined(M_I86SM) || defined(M_I86MM))
  46. #define _heapchk _nheapchk
  47. #define _heapset _nheapset
  48. #define _heapwalk _nheapwalk
  49. #endif
  50. #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
  51. #define _heapchk _fheapchk
  52. #define _heapset _fheapset
  53. #define _heapwalk _fheapwalk
  54. #endif
  55. #ifndef NO_EXT_KEYS /* extensions enabled */
  56. #define _CDECL cdecl
  57. #define _NEAR near
  58. #else /* extensions not enabled */
  59. #define _CDECL
  60. #define _NEAR
  61. #endif /* NO_EXT_KEYS */
  62. /* external variable declarations */
  63. extern unsigned int _NEAR _CDECL _amblksiz;
  64. /* function prototypes */
  65. void * _CDECL alloca(size_t);
  66. void * _CDECL calloc(size_t, size_t);
  67. void * _CDECL _expand(void *, size_t);
  68. int _CDECL _fheapchk(void);
  69. int _CDECL _fheapset(unsigned int);
  70. unsigned int _CDECL _freect(size_t);
  71. void _CDECL free(void *);
  72. void * _CDECL malloc(size_t);
  73. size_t _CDECL _memavl(void);
  74. size_t _CDECL _memmax(void);
  75. size_t _CDECL _msize(void *);
  76. int _CDECL _nheapchk(void);
  77. int _CDECL _nheapset(unsigned int);
  78. void * _CDECL realloc(void *, size_t);
  79. void * _CDECL sbrk(int);
  80. size_t _CDECL stackavail(void);
  81. #ifndef NO_EXT_KEYS /* extensions enabled */
  82. void cdecl _ffree(void far *);
  83. void far * cdecl _fmalloc(size_t);
  84. size_t cdecl _fmsize(void far *);
  85. #ifndef _QC
  86. void huge * cdecl halloc(long, size_t);
  87. void cdecl hfree(void huge *);
  88. #endif
  89. void cdecl _nfree(void near *);
  90. void near * cdecl _nmalloc(size_t);
  91. size_t cdecl _nmsize(void near *);
  92. int cdecl _nheapwalk(struct _heapinfo *);
  93. int cdecl _fheapwalk(struct _heapinfo *);
  94. #else
  95. #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
  96. int _nheapwalk(struct _heapinfo *);
  97. int _fheapwalk(struct _heapinfo *);
  98. #endif /* M_I86CM || M_I86LM || M_I86HM */
  99. #endif /* NO_EXT_KEYS */