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)
46 /* maximum size of a user request for memory */
47 #define _HEAP_MAXREQ 0xFFFFFFE0
53 The _heap* memory allocation functions are supported on NT
54 but not W9x. On latter, they always set errno to ENOSYS.
56 _CRTIMP
int __cdecl __MINGW_NOTHROW
_heapwalk (_HEAPINFO
*);
58 #define _alloca(x) __builtin_alloca((x))
62 _CRTIMP
int __cdecl __MINGW_NOTHROW
heapwalk (_HEAPINFO
*);
64 #define alloca(x) __builtin_alloca((x))
66 #endif /* Not _NO_OLDNAMES */
68 _CRTIMP
int __cdecl __MINGW_NOTHROW
_heapchk (void); /* Verify heap integrety. */
69 _CRTIMP
int __cdecl __MINGW_NOTHROW
_heapmin (void); /* Return unused heap to the OS. */
70 _CRTIMP
int __cdecl __MINGW_NOTHROW
_heapset (unsigned int);
72 _CRTIMP
size_t __cdecl __MINGW_NOTHROW
_msize (void*);
73 _CRTIMP
size_t __cdecl __MINGW_NOTHROW
_get_sbh_threshold (void);
74 _CRTIMP
int __cdecl __MINGW_NOTHROW
_set_sbh_threshold (size_t);
75 _CRTIMP
void* __cdecl __MINGW_NOTHROW
_expand (void*, size_t);
77 /* These require msvcr70.dll or higher. */
78 #if __MSVCRT_VERSION__ >= 0x0700
79 _CRTIMP
void * __cdecl __MINGW_NOTHROW
_aligned_offset_malloc(size_t, size_t, size_t);
80 _CRTIMP
void * __cdecl __MINGW_NOTHROW
_aligned_offset_realloc(void*, size_t, size_t, size_t);
81 _CRTIMP
void * __cdecl __MINGW_NOTHROW
_aligned_offset_recalloc(void*, size_t, size_t, size_t, size_t);
83 _CRTIMP
void * __cdecl __MINGW_NOTHROW
_aligned_malloc (size_t, size_t);
84 _CRTIMP
void * __cdecl __MINGW_NOTHROW
_aligned_realloc (void*, size_t, size_t);
85 _CRTIMP
void* __cdecl __MINGW_NOTHROW
_aligned_recalloc(void*, size_t, size_t, size_t);
86 _CRTIMP
void __cdecl __MINGW_NOTHROW
_aligned_free (void*);
87 #endif /* __MSVCRT_VERSION__ >= 0x0700 */
89 /* These require libmingwex.a. */
90 void * __cdecl __MINGW_NOTHROW
__mingw_aligned_offset_malloc (size_t, size_t, size_t);
91 void * __cdecl __MINGW_NOTHROW
__mingw_aligned_offset_realloc (void*, size_t, size_t, size_t);
93 void * __cdecl __MINGW_NOTHROW
__mingw_aligned_malloc (size_t, size_t);
94 void * __cdecl __MINGW_NOTHROW
__mingw_aligned_realloc (void*, size_t, size_t);
95 void __cdecl __MINGW_NOTHROW
__mingw_aligned_free (void*);
101 #endif /* RC_INVOKED */
103 #endif /* Not _MALLOC_H_ */