Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / include / malloc.h
blob5afa2916f438ec02cb74d0cdf1e3040b8b5cf3bb
1 /*
2 * malloc.h
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
10 * instead.
14 #ifndef _MALLOC_H_
15 #define _MALLOC_H_
17 /* All the headers include this file. */
18 #include <_mingw.h>
20 #include <stdlib.h>
22 #ifndef RC_INVOKED
25 * The structure used to walk through the heap with _heapwalk.
27 typedef struct _heapinfo
29 int* _pentry;
30 size_t _size;
31 int _useflag;
32 } _HEAPINFO;
34 /* Values for _heapinfo.useflag */
35 #define _FREEENTRY 0
36 #define _USEDENTRY 1
38 /* Return codes for _heapwalk() */
39 #define _HEAPEMPTY (-1)
40 #define _HEAPOK (-2)
41 #define _HEAPBADBEGIN (-3)
42 #define _HEAPBADNODE (-4)
43 #define _HEAPEND (-5)
44 #define _HEAPBADPTR (-6)
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
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*);
54 #ifdef __GNUC__
55 #define _alloca(x) __builtin_alloca((x))
56 #endif
58 #ifndef _NO_OLDNAMES
59 _CRTIMP int __cdecl heapwalk (_HEAPINFO*);
60 #ifdef __GNUC__
61 #define alloca(x) __builtin_alloca((x))
62 #endif
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*);
92 #ifdef __cplusplus
94 #endif
96 #endif /* RC_INVOKED */
98 #endif /* Not _MALLOC_H_ */