2 *malloc.h - declarations and definitions for memory allocation functions
4 * Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
7 * Contains the function declarations for memory allocation functions;
8 * also defines manifest constants and types used by the heap routines.
11 *******************************************************************************/
16 #define _HEAPBADBEGIN -3
17 #define _HEAPBADNODE -4
19 #define _HEAPBADPTR -6
23 #ifndef _SIZE_T_DEFINED
24 typedef unsigned int size_t;
25 #define _SIZE_T_DEFINED
28 #if (!defined(NO_EXT_KEYS))
30 #ifndef _HEAPINFO_DEFINED
31 typedef struct _heapinfo {
36 #define _HEAPINFO_DEFINED
39 #else /* NO_EXT_KEYS */
40 #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
42 #ifndef _HEAPINFO_DEFINED
44 typedef struct _heapinfo {
50 #define _HEAPINFO_DEFINED
53 #endif /* M_I86CM || M_I86LM || M_I86HM */
55 #endif /* NO_EXT_KEYS */
58 #if (defined(M_I86SM) || defined(M_I86MM))
59 #define _heapchk _nheapchk
60 #define _heapset _nheapset
61 #define _heapwalk _nheapwalk
63 #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
64 #define _heapchk _fheapchk
65 #define _heapset _fheapset
66 #define _heapwalk _fheapwalk
69 #ifndef NO_EXT_KEYS /* extensions enabled */
72 #else /* extensions not enabled */
75 #endif /* NO_EXT_KEYS */
78 /* external variable declarations */
79 extern unsigned int _NEAR _CDECL _amblksiz;
81 /* function prototypes */
83 void * _CDECL alloca(size_t);
84 void * _CDECL calloc(size_t, size_t);
85 void * _CDECL _expand(void *, size_t);
86 int _CDECL _fheapchk(void);
87 int _CDECL _fheapset(unsigned int);
88 unsigned int _CDECL _freect(size_t);
89 void _CDECL free(void *);
90 void * _CDECL malloc(size_t);
91 size_t _CDECL _memavl(void);
92 size_t _CDECL _memmax(void);
93 size_t _CDECL _msize(void *);
94 int _CDECL _nheapchk(void);
95 int _CDECL _nheapset(unsigned int);
96 void * _CDECL realloc(void *, size_t);
97 void * _CDECL sbrk(int);
98 size_t _CDECL stackavail(void);
101 #ifndef NO_EXT_KEYS /* extensions enabled */
103 void cdecl _ffree(void far *);
104 void far * cdecl _fmalloc(size_t);
105 size_t cdecl _fmsize(void far *);
107 void huge * cdecl halloc(long, size_t);
108 void cdecl hfree(void huge *);
110 void cdecl _nfree(void near *);
111 void near * cdecl _nmalloc(size_t);
112 size_t cdecl _nmsize(void near *);
113 int cdecl _nheapwalk(struct _heapinfo *);
114 int cdecl _fheapwalk(struct _heapinfo *);
117 #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
119 int _nheapwalk(struct _heapinfo *);
120 int _fheapwalk(struct _heapinfo *);
122 #endif /* M_I86CM || M_I86LM || M_I86HM */
124 #endif /* NO_EXT_KEYS */