summaryrefslogtreecommitdiffstats
path: root/private/crtlib/include/malloc.h
blob: d199ba6fd2c00d6b06c23704f52192cedc08cc11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/***
*malloc.h - declarations and definitions for memory allocation functions
*
*	Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved.
*
*Purpose:
*	Contains the function declarations for memory allocation functions;
*	also defines manifest constants and types used by the heap routines.
*	[System V]
*
****/

#ifndef _INC_MALLOC

#ifdef __cplusplus
extern "C" {
#endif


/*
 * Conditional macro definition for function calling type and variable type
 * qualifiers.
 */
#if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )

/*
 * Definitions for MS C8-32 (386/486) compiler
 */
#define _CRTAPI1 __cdecl
#define _CRTAPI2 __cdecl

#else

/*
 * Other compilers (e.g., MIPS)
 */
#define _CRTAPI1
#define _CRTAPI2

#endif


#ifndef _SIZE_T_DEFINED
typedef unsigned int size_t;
#define _SIZE_T_DEFINED
#endif

/* maximum heap request that can ever be honored */
#define _HEAP_MAXREQ	0xFFFFFFD8

/* constants for _heapchk/_heapset/_heapwalk routines */
#define _HEAPEMPTY	(-1)
#define _HEAPOK 	(-2)
#define _HEAPBADBEGIN	(-3)
#define _HEAPBADNODE	(-4)
#define _HEAPEND	(-5)
#define _HEAPBADPTR	(-6)
#define _FREEENTRY	0
#define _USEDENTRY	1

#ifndef _HEAPINFO_DEFINED
typedef struct _heapinfo {
	int * _pentry;
	size_t _size;
	int _useflag;
	} _HEAPINFO;
#define _HEAPINFO_DEFINED
#endif


/* function prototypes */
void * _CRTAPI1 calloc(size_t, size_t);
void   _CRTAPI1 free(void *);
void * _CRTAPI1 malloc(size_t);
void * _CRTAPI1 realloc(void *, size_t);

#ifndef _POSIX_
void * _CRTAPI1 _alloca(size_t);
void * _CRTAPI1 _expand(void *, size_t);
int _CRTAPI1 _heapchk(void);
int _CRTAPI1 _heapmin(void);
int _CRTAPI1 _heapset(unsigned int);
int _CRTAPI1 _heapwalk(_HEAPINFO *);
size_t _CRTAPI1 _msize(void *);
#endif  /* !_POSIX_ */

#if !__STDC__
/* Non-ANSI names for compatibility */
#define alloca	   _alloca
#endif	/* __STDC__*/

#if defined(_M_MRX000) || defined(_M_PPC)
#pragma intrinsic(_alloca)
#endif

#ifdef __cplusplus
}
#endif

#define _INC_MALLOC
#endif	/* _INC_MALLOC */