16#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
25 #define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0
27 #define _HEAP_MAXREQ 0xFFFFFFE0
33#define _HEAPEMPTY (-1)
35#define _HEAPBADBEGIN (-3)
36#define _HEAPBADNODE (-4)
38#define _HEAPBADPTR (-6)
49#define _mm_free(a) _aligned_free(a)
50#define _mm_malloc(a, b) _aligned_malloc(a, b)
53#if defined(__GNUC__) || defined(__clang__)
54#define _alloca(x) __builtin_alloca((x))
62#if !defined __midl && !defined RC_INVOKED
69 #if defined _DEBUG || defined _CRT_USE_WINAPI_FAMILY_DESKTOP_APP || defined _CORECRT_BUILD
73 #if defined _CRT_USE_WINAPI_FAMILY_DESKTOP_APP || defined _CRT_USE_WINAPI_FAMILY_GAMES
79 #define _ALLOCA_S_THRESHOLD 1024
80 #define _ALLOCA_S_STACK_MARKER 0xCCCC
81 #define _ALLOCA_S_HEAP_MARKER 0xDDDD
84 #define _ALLOCA_S_MARKER_SIZE 16
86 #define _ALLOCA_S_MARKER_SIZE 8
93 #pragma warning(disable: 6540)
100 *((
unsigned int*)_Ptr) = _Marker;
109 return _MarkedSize >
_Size ? _MarkedSize : 0;
121 #ifndef _CRTDBG_MAP_ALLOC
123 #define _malloca(size) \
124 __pragma(warning(suppress: 6255 6386)) \
125 (_MallocaComputeSize(size) != 0 \
126 ? _MarkAllocaS(malloc(_MallocaComputeSize(size)), _ALLOCA_S_HEAP_MARKER) \
133 #define _malloca(size) \
134 __pragma(warning(suppress: 6255 6386)) \
135 (_MallocaComputeSize(size) != 0 \
136 ? (((_MallocaComputeSize(size) <= _ALLOCA_S_THRESHOLD) \
137 ? _MarkAllocaS(_alloca(_MallocaComputeSize(size)), _ALLOCA_S_STACK_MARKER) \
138 : _MarkAllocaS(malloc(_MallocaComputeSize(size)), _ALLOCA_S_HEAP_MARKER))) \
145#if defined __midl && !defined RC_INVOKED
146#elif defined _DEBUG && defined _CRTDBG_MAP_ALLOC
151 #pragma warning(push)
152 #pragma warning(disable: 6014)
155 unsigned int _Marker;
159 _Marker = *(
unsigned int*)_Memory;
167 _ASSERTE((
"Corrupted pointer passed to _freea" && 0));
178#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
179 #define alloca _alloca
struct _heapinfo _HEAPINFO
_Check_return_ _CRTIMP int __cdecl _heapchk(void)
#define _ALLOCA_S_STACK_MARKER
_CRTIMP int __cdecl _heapwalk(_Inout_ _HEAPINFO *_EntryInfo)
static __inline void * _MarkAllocaS(void *_Ptr, unsigned int _Marker)
static __inline void __cdecl _freea(void *_Memory)
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Size
_CRTIMP intptr_t __cdecl _get_heap_handle(void)
_Check_return_ _CRTIMP int __cdecl _heapmin(void)
#define _ALLOCA_S_HEAP_MARKER
_CRTIMP int __cdecl _resetstkoflw(void)
#define _Post_writable_byte_size_(s)
#define _STATIC_ASSERT(expr)
#define __crt_typefix(ctype)
#define _UCRT_DISABLE_CLANG_WARNINGS
#define _UCRT_RESTORE_CLANG_WARNINGS
__inline size_t _MallocaComputeSize(size_t _Size)
#define _ALLOCA_S_MARKER_SIZE
#define _CRT_END_C_HEADER
#define _CRT_BEGIN_C_HEADER