summaryrefslogtreecommitdiff
path: root/v4.0/src/TOOLS/BLD/INC/MALLOC.H
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0/src/TOOLS/BLD/INC/MALLOC.H')
-rw-r--r--v4.0/src/TOOLS/BLD/INC/MALLOC.H124
1 files changed, 124 insertions, 0 deletions
diff --git a/v4.0/src/TOOLS/BLD/INC/MALLOC.H b/v4.0/src/TOOLS/BLD/INC/MALLOC.H
new file mode 100644
index 0000000..e2aa979
--- /dev/null
+++ b/v4.0/src/TOOLS/BLD/INC/MALLOC.H
@@ -0,0 +1,124 @@
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
13
14#define _HEAPEMPTY -1
15#define _HEAPOK -2
16#define _HEAPBADBEGIN -3
17#define _HEAPBADNODE -4
18#define _HEAPEND -5
19#define _HEAPBADPTR -6
20#define _FREEENTRY 0
21#define _USEDENTRY 1
22
23#ifndef _SIZE_T_DEFINED
24typedef unsigned int size_t;
25#define _SIZE_T_DEFINED
26#endif
27
28#if (!defined(NO_EXT_KEYS))
29
30#ifndef _HEAPINFO_DEFINED
31typedef struct _heapinfo {
32 int far * _pentry;
33 size_t _size;
34 int _useflag;
35 } _HEAPINFO;
36#define _HEAPINFO_DEFINED
37#endif
38
39#else /* NO_EXT_KEYS */
40#if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
41
42#ifndef _HEAPINFO_DEFINED
43
44typedef struct _heapinfo {
45 int * _pentry;
46 size_t _size;
47 int _useflag;
48 } _HEAPINFO;
49
50#define _HEAPINFO_DEFINED
51#endif
52
53#endif /* M_I86CM || M_I86LM || M_I86HM */
54
55#endif /* NO_EXT_KEYS */
56
57
58#if (defined(M_I86SM) || defined(M_I86MM))
59#define _heapchk _nheapchk
60#define _heapset _nheapset
61#define _heapwalk _nheapwalk
62#endif
63#if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
64#define _heapchk _fheapchk
65#define _heapset _fheapset
66#define _heapwalk _fheapwalk
67#endif
68
69#ifndef NO_EXT_KEYS /* extensions enabled */
70 #define _CDECL cdecl
71 #define _NEAR near
72#else /* extensions not enabled */
73 #define _CDECL
74 #define _NEAR
75#endif /* NO_EXT_KEYS */
76
77
78/* external variable declarations */
79extern unsigned int _NEAR _CDECL _amblksiz;
80
81/* function prototypes */
82
83void * _CDECL alloca(size_t);
84void * _CDECL calloc(size_t, size_t);
85void * _CDECL _expand(void *, size_t);
86int _CDECL _fheapchk(void);
87int _CDECL _fheapset(unsigned int);
88unsigned int _CDECL _freect(size_t);
89void _CDECL free(void *);
90void * _CDECL malloc(size_t);
91size_t _CDECL _memavl(void);
92size_t _CDECL _memmax(void);
93size_t _CDECL _msize(void *);
94int _CDECL _nheapchk(void);
95int _CDECL _nheapset(unsigned int);
96void * _CDECL realloc(void *, size_t);
97void * _CDECL sbrk(int);
98size_t _CDECL stackavail(void);
99
100
101#ifndef NO_EXT_KEYS /* extensions enabled */
102
103void cdecl _ffree(void far *);
104void far * cdecl _fmalloc(size_t);
105size_t cdecl _fmsize(void far *);
106#ifndef _QC
107void huge * cdecl halloc(long, size_t);
108void cdecl hfree(void huge *);
109#endif
110void cdecl _nfree(void near *);
111void near * cdecl _nmalloc(size_t);
112size_t cdecl _nmsize(void near *);
113int cdecl _nheapwalk(struct _heapinfo *);
114int cdecl _fheapwalk(struct _heapinfo *);
115
116#else
117#if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
118
119int _nheapwalk(struct _heapinfo *);
120int _fheapwalk(struct _heapinfo *);
121
122#endif /* M_I86CM || M_I86LM || M_I86HM */
123
124#endif /* NO_EXT_KEYS */