11#pragma pack(push,_CRT_PACKING)
13#ifndef _MM_MALLOC_H_INCLUDED
14#define _MM_MALLOC_H_INCLUDED
22#define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0
24#define _HEAP_MAXREQ 0xFFFFFFE0
28#define _HEAPEMPTY (-1)
30#define _HEAPBADBEGIN (-3)
31#define _HEAPBADNODE (-4)
33#define _HEAPBADPTR (-6)
39#ifndef _HEAPINFO_DEFINED
40#define _HEAPINFO_DEFINED
52#if (!defined (_XMMINTRIN_H_INCLUDED) && !defined (_MM_MALLOC_H_INCLUDED)) || defined(_aligned_malloc)
53#define __DO_ALIGN_DEFINES
56#ifdef __DO_ALIGN_DEFINES
57#pragma push_macro("_aligned_free")
58#pragma push_macro("_aligned_malloc")
63#define _mm_free(a) _aligned_free(a)
64#define _mm_malloc(a,b) _aligned_malloc(a,b)
66#ifndef _CRT_ALLOCATION_DEFINED
67#define _CRT_ALLOCATION_DEFINED
75 _In_ size_t _NumOfElements,
111#ifdef __DO_ALIGN_DEFINES
183 _aligned_offset_recalloc(
192#ifdef __DO_ALIGN_DEFINES
193#undef __DO_ALIGN_DEFINES
195#pragma pop_macro("_aligned_malloc")
196#pragma pop_macro("_aligned_free")
200#define _MAX_WAIT_MALLOC_CRT 60000
208 _In_ unsigned long _NewValue);
229#define _alloca(x) __builtin_alloca((x))
249 _In_ size_t _NewValue);
287 _In_ unsigned int _Fill);
307#define _ALLOCA_S_THRESHOLD 1024
308#define _ALLOCA_S_STACK_MARKER 0xCCCC
309#define _ALLOCA_S_HEAP_MARKER 0xDDDD
311#if(defined(_X86_) && !defined(__x86_64))
312#define _ALLOCA_S_MARKER_SIZE 8
313#elif defined(__ia64__) || defined(__x86_64) || defined(__arm64__)
314#define _ALLOCA_S_MARKER_SIZE 16
315#elif defined(__arm__)
316#define _ALLOCA_S_MARKER_SIZE 8
319#if !defined(RC_INVOKED)
322 *((
unsigned int*)_Ptr) = _Marker;
323 _Ptr = (
char*)_Ptr + _ALLOCA_S_MARKER_SIZE;
330#define _malloca(size) \
331 ((((size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) ? \
332 _MarkAllocaS(_alloca((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_STACK_MARKER) : \
333 _MarkAllocaS(malloc((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_HEAP_MARKER))
340 unsigned int _Marker;
342 _Memory = (
char*)_Memory - _ALLOCA_S_MARKER_SIZE;
343 _Marker = *(
unsigned int *)_Memory;
349 _ASSERTE((
"Corrupted pointer passed to _freea",0));
357#define alloca _alloca
361#ifndef _HEAPHOOK_DEFINED
362#define _HEAPHOOK_DEFINED
372#define _HEAP_MALLOC 1
373#define _HEAP_CALLOC 2
375#define _HEAP_REALLOC 4
377#define _HEAP_EXPAND 6
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
_CRTIMP void __cdecl _aligned_free(_Pre_maybenull_ _Post_invalid_ void *_Memory)
void * _expand(void *_ptr, size_t _size)
struct _heapinfo _HEAPINFO
_Check_return_ _CRTIMP int __cdecl _heapchk(void)
_Check_return_ _Ret_maybenull_ _In_ size_t _SizeOfElements
#define _ALLOCA_S_STACK_MARKER
_Check_return_ _Ret_maybenull_ _In_ size_t _Count
_CRTIMP int __cdecl _heapwalk(_Inout_ _HEAPINFO *_EntryInfo)
_CRTIMP int __cdecl _set_sbh_threshold(_In_ size_t _NewValue)
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 _Offset
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Size
_Check_return_ _CRTIMP int __cdecl _heapadd(_In_ void *_Memory, _In_ size_t _Size)
_CRTIMP intptr_t __cdecl _get_heap_handle(void)
_CRTIMP errno_t __cdecl _set_amblksiz(_In_ size_t _Value)
_CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait(_In_ unsigned long _NewValue)
_Check_return_ _Ret_maybenull_ _In_ size_t _Alignment
_Check_return_ _CRTIMP size_t __cdecl _msize(_In_ void *_Memory)
_Check_return_ _Ret_maybenull_ _In_ size_t _NewSize
_Check_return_ _CRTIMP int __cdecl _heapmin(void)
_CRTIMP int __cdecl _heapset(_In_ unsigned int _Fill)
_CRTIMP errno_t __cdecl _get_amblksiz(_Out_ size_t *_Value)
#define _ALLOCA_S_HEAP_MARKER
_Check_return_ _CRTIMP size_t __cdecl _get_sbh_threshold(void)
_CRTIMP size_t __cdecl _heapused(size_t *_Used, size_t *_Commit)
_CRTIMP int __cdecl _resetstkoflw(void)
#define _Post_writable_byte_size_(s)
void *CDECL _aligned_offset_realloc(void *memblock, MSVCRT_size_t size, MSVCRT_size_t alignment, MSVCRT_size_t offset)
void *CDECL _aligned_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment)
void *CDECL _aligned_offset_malloc(MSVCRT_size_t size, MSVCRT_size_t alignment, MSVCRT_size_t offset)
void *CDECL _aligned_realloc(void *memblock, MSVCRT_size_t size, MSVCRT_size_t alignment)