STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
corecrt_malloc.h
Go to the documentation of this file.
1 //
2 // corecrt_malloc.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // The memory allocation library. These pieces of the allocation library are
7 // shared by both <stdlib.h> and <malloc.h>.
8 //
9 #pragma once
10 
11 #include <corecrt.h>
12 
14 
15 
16 
17 #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC
18  #pragma push_macro("_aligned_free")
19  #pragma push_macro("_aligned_malloc")
20  #pragma push_macro("_aligned_msize")
21  #pragma push_macro("_aligned_offset_malloc")
22  #pragma push_macro("_aligned_offset_realloc")
23  #pragma push_macro("_aligned_offset_recalloc")
24  #pragma push_macro("_aligned_realloc")
25  #pragma push_macro("_aligned_recalloc")
26  #pragma push_macro("_expand")
27  #pragma push_macro("_freea")
28  #pragma push_macro("_msize")
29  #pragma push_macro("_recalloc")
30  #pragma push_macro("calloc")
31  #pragma push_macro("free")
32  #pragma push_macro("malloc")
33  #pragma push_macro("realloc")
34 
35  #undef _aligned_free
36  #undef _aligned_malloc
37  #undef _aligned_msize
38  #undef _aligned_offset_malloc
39  #undef _aligned_offset_realloc
40  #undef _aligned_offset_recalloc
41  #undef _aligned_realloc
42  #undef _aligned_recalloc
43  #undef _expand
44  #undef _freea
45  #undef _msize
46  #undef _recalloc
47  #undef calloc
48  #undef free
49  #undef malloc
50  #undef realloc
51 #endif
52 
55 void* __cdecl _calloc_base(
56  _In_ size_t _Count,
57  _In_ size_t _Size
58  );
59 
62 void* __cdecl calloc(
65  );
66 
68 _ACRTIMP int __cdecl _callnewh(
69  _In_ size_t _Size
70  );
71 
74 void* __cdecl _expand(
75  _Pre_notnull_ void* _Block,
77  );
78 
80 void __cdecl _free_base(
81  _Pre_maybenull_ _Post_invalid_ void* _Block
82  );
83 
85 void __cdecl free(
86  _Pre_maybenull_ _Post_invalid_ void* _Block
87  );
88 
91 void* __cdecl _malloc_base(
92  _In_ size_t _Size
93  );
94 
97 void* __cdecl malloc(
98  _In_ _CRT_GUARDOVERFLOW size_t _Size
99  );
100 
102 _ACRTIMP
103 size_t __cdecl _msize_base(
104  _Pre_notnull_ void* _Block
105  );
106 
108 _ACRTIMP
109 size_t __cdecl _msize(
110  _Pre_notnull_ void* _Block
111  );
112 
115 void* __cdecl _realloc_base(
116  _Pre_maybenull_ _Post_invalid_ void* _Block,
117  _In_ size_t _Size
118  );
119 
122 void* __cdecl realloc(
123  _Pre_maybenull_ _Post_invalid_ void* _Block,
124  _In_ _CRT_GUARDOVERFLOW size_t _Size
125  );
126 
129 void* __cdecl _recalloc_base(
130  _Pre_maybenull_ _Post_invalid_ void* _Block,
131  _In_ size_t _Count,
132  _In_ size_t _Size
133  );
134 
137 void* __cdecl _recalloc(
138  _Pre_maybenull_ _Post_invalid_ void* _Block,
139  _In_ _CRT_GUARDOVERFLOW size_t _Count,
140  _In_ _CRT_GUARDOVERFLOW size_t _Size
141  );
142 
143 _ACRTIMP
144 void __cdecl _aligned_free(
145  _Pre_maybenull_ _Post_invalid_ void* _Block
146  );
147 
150 void* __cdecl _aligned_malloc(
151  _In_ _CRT_GUARDOVERFLOW size_t _Size,
152  _In_ size_t _Alignment
153  );
154 
157 void* __cdecl _aligned_offset_malloc(
158  _In_ _CRT_GUARDOVERFLOW size_t _Size,
159  _In_ size_t _Alignment,
160  _In_ size_t _Offset
161  );
162 
164 _ACRTIMP
165 size_t __cdecl _aligned_msize(
166  _Pre_notnull_ void* _Block,
167  _In_ size_t _Alignment,
168  _In_ size_t _Offset
169  );
170 
173 void* __cdecl _aligned_offset_realloc(
174  _Pre_maybenull_ _Post_invalid_ void* _Block,
175  _In_ _CRT_GUARDOVERFLOW size_t _Size,
176  _In_ size_t _Alignment,
177  _In_ size_t _Offset
178  );
179 
182 void* __cdecl _aligned_offset_recalloc(
183  _Pre_maybenull_ _Post_invalid_ void* _Block,
184  _In_ _CRT_GUARDOVERFLOW size_t _Count,
185  _In_ _CRT_GUARDOVERFLOW size_t _Size,
186  _In_ size_t _Alignment,
187  _In_ size_t _Offset
188  );
189 
192 void* __cdecl _aligned_realloc(
193  _Pre_maybenull_ _Post_invalid_ void* _Block,
194  _In_ _CRT_GUARDOVERFLOW size_t _Size,
195  _In_ size_t _Alignment
196  );
197 
200 void* __cdecl _aligned_recalloc(
201  _Pre_maybenull_ _Post_invalid_ void* _Block,
202  _In_ _CRT_GUARDOVERFLOW size_t _Count,
203  _In_ _CRT_GUARDOVERFLOW size_t _Size,
204  _In_ size_t _Alignment
205  );
206 
207 #if defined _DEBUG && defined _CRTDBG_MAP_ALLOC
208  #pragma pop_macro("realloc")
209  #pragma pop_macro("malloc")
210  #pragma pop_macro("free")
211  #pragma pop_macro("calloc")
212  #pragma pop_macro("_recalloc")
213  #pragma pop_macro("_msize")
214  #pragma pop_macro("_freea")
215  #pragma pop_macro("_expand")
216  #pragma pop_macro("_aligned_recalloc")
217  #pragma pop_macro("_aligned_realloc")
218  #pragma pop_macro("_aligned_offset_recalloc")
219  #pragma pop_macro("_aligned_offset_realloc")
220  #pragma pop_macro("_aligned_offset_malloc")
221  #pragma pop_macro("_aligned_msize")
222  #pragma pop_macro("_aligned_malloc")
223  #pragma pop_macro("_aligned_free")
224 #endif
225 
226 
227 
return
Definition: corecrt_memcpy_s.h:60
#define _ACRTIMP
Definition: corecrt.h:27
_ACRTIMP void __cdecl free(_Pre_maybenull_ _Post_invalid_ void *_Block)
_Check_return_ _Ret_maybenull_ _In_ size_t _Alignment
Definition: corecrt_malloc.h:153
#define _Ret_maybenull_
Definition: sal.h:526
#define _Post_invalid_
Definition: sal.h:692
_Check_return_ _ACRTIMP size_t __cdecl _msize(_Pre_notnull_ void *_Block)
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
#define _CRTRESTRICT
Definition: corecrt.h:50
#define _Pre_maybenull_
Definition: sal.h:678
_ACRTIMP void __cdecl _free_base(_Pre_maybenull_ _Post_invalid_ void *_Block)
#define _Check_return_
Definition: sal.h:554
#define _In_
Definition: sal.h:305
#define _CRT_JIT_INTRINSIC
Definition: corecrt.h:64
_Success_(return!=0) _Check_return_ _Ret_maybenull_ _Post_writable_byte_size_(_Size) _ACRTIMP _CRTALLOCATOR _CRTRESTRICT void *__cdecl _realloc_base(_Pre_maybenull_ _Post_invalid_ void *_Block
#define _CRTALLOCATOR
Definition: corecrt.h:56
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _Post_writable_byte_size_(_Count *_Size) _ACRTIMP _CRTALLOCATOR _CRTRESTRICT void *__cdecl _calloc_base(_In_ size_t _Count
_ACRTIMP void __cdecl _aligned_free(_Pre_maybenull_ _Post_invalid_ void *_Block)
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76
_Check_return_ _ACRTIMP int __cdecl _callnewh(_In_ size_t _Size)
_In_ size_t _Count
Definition: corecrt_malloc.h:131
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Offset
Definition: corecrt_malloc.h:159
#define _CRT_GUARDOVERFLOW
Definition: corecrt.h:71
_Check_return_ _ACRTIMP size_t __cdecl _msize_base(_Pre_notnull_ void *_Block)
#define _Pre_notnull_
Definition: sal.h:677
_Check_return_ _ACRTIMP size_t __cdecl _aligned_msize(_Pre_notnull_ void *_Block, _In_ size_t _Alignment, _In_ size_t _Offset)