3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is a part of the mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within the package.
7 * Support for programs which want to use malloc.h to get memory management
8 * functions. Unless you absolutely need some of these functions and they are
9 * not in the ANSI headers you should use the ANSI standard header files
17 /* All the headers include this file. */
25 * The structure used to walk through the heap with _heapwalk.
27 typedef struct _heapinfo
34 /* Values for _heapinfo.useflag */
38 /* Return codes for _heapwalk() */
39 #define _HEAPEMPTY (-1)
41 #define _HEAPBADBEGIN (-3)
42 #define _HEAPBADNODE (-4)
44 #define _HEAPBADPTR (-6)
50 The _heap* memory allocation functions are supported on NT
51 but not W9x. On latter, they always set errno to ENOSYS.
53 _CRTIMP
int __cdecl
_heapwalk (_HEAPINFO
*);
55 #define _alloca(x) __builtin_alloca((x))
59 _CRTIMP
int __cdecl
heapwalk (_HEAPINFO
*);
61 #define alloca(x) __builtin_alloca((x))
63 #endif /* Not _NO_OLDNAMES */
65 _CRTIMP
int __cdecl
_heapchk (void); /* Verify heap integrety. */
66 _CRTIMP
int __cdecl
_heapmin (void); /* Return unused heap to the OS. */
67 _CRTIMP
int __cdecl
_heapset (unsigned int);
69 _CRTIMP
size_t __cdecl
_msize (void*);
70 _CRTIMP
size_t __cdecl
_get_sbh_threshold (void);
71 _CRTIMP
int __cdecl
_set_sbh_threshold (size_t);
72 _CRTIMP
void* __cdecl
_expand (void*, size_t);
74 /* These require msvcr70.dll or higher. */
75 #if __MSVCRT_VERSION__ >= 0x0700
76 _CRTIMP
void * __cdecl
_aligned_offset_malloc(size_t, size_t, size_t);
77 _CRTIMP
void * __cdecl
_aligned_offset_realloc(void*, size_t, size_t, size_t);
79 _CRTIMP
void * __cdecl
_aligned_malloc (size_t, size_t);
80 _CRTIMP
void * __cdecl
_aligned_realloc (void*, size_t, size_t);
81 _CRTIMP
void __cdecl
_aligned_free (void*);
82 #endif /* __MSVCRT_VERSION__ >= 0x0700 */
84 /* These require libmingwex.a. */
85 void * __cdecl
__mingw_aligned_offset_malloc (size_t, size_t, size_t);
86 void * __cdecl
__mingw_aligned_offset_realloc (void*, size_t, size_t, size_t);
88 void * __cdecl
__mingw_aligned_malloc (size_t, size_t);
89 void * __cdecl
__mingw_aligned_realloc (void*, size_t, size_t);
90 void __cdecl
__mingw_aligned_free (void*);
96 #endif /* RC_INVOKED */
98 #endif /* Not _MALLOC_H_ */