STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Typedefs | Functions
malloc.h File Reference
#include <corecrt.h>
#include <corecrt_malloc.h>

Go to the source code of this file.

Classes

struct  _heapinfo
 

Macros

#define _INC_MALLOC
 
#define _HEAP_MAXREQ   0xFFFFFFE0
 
#define _HEAPEMPTY   (-1)
 
#define _HEAPOK   (-2)
 
#define _HEAPBADBEGIN   (-3)
 
#define _HEAPBADNODE   (-4)
 
#define _HEAPEND   (-5)
 
#define _HEAPBADPTR   (-6)
 
#define _FREEENTRY   0
 
#define _USEDENTRY   1
 
#define _mm_free(a)   _aligned_free(a)
 
#define _mm_malloc(a, b)   _aligned_malloc(a, b)
 
#define _ALLOCA_S_THRESHOLD   1024
 
#define _ALLOCA_S_STACK_MARKER   0xCCCC
 
#define _ALLOCA_S_HEAP_MARKER   0xDDDD
 
#define _ALLOCA_S_MARKER_SIZE   8
 
#define _malloca(size)
 
#define alloca   _alloca
 

Typedefs

typedef struct _heapinfo _HEAPINFO
 

Functions

_Ret_notnull_ _Post_writable_byte_size_ (_Size) void *__cdecl _alloca(_In_ size_t _Size)
 
_ACRTIMP intptr_t __cdecl _get_heap_handle (void)
 
_Check_return_ _DCRTIMP int __cdecl _heapmin (void)
 
_ACRTIMP int __cdecl _heapwalk (_Inout_ _HEAPINFO *_EntryInfo)
 
_Check_return_ _DCRTIMP int __cdecl _heapchk (void)
 
_DCRTIMP int __cdecl _resetstkoflw (void)
 
 _STATIC_ASSERT (sizeof(unsigned int)<=_ALLOCA_S_MARKER_SIZE)
 
__inline void_MarkAllocaS (_Out_opt_ __crt_typefix(unsigned int *) void *_Ptr, unsigned int _Marker)
 
__inline size_t _MallocaComputeSize (size_t _Size)
 
__inline void __CRTDECL _freea (_Pre_maybenull_ _Post_invalid_ void *_Memory)
 

Macro Definition Documentation

#define _ALLOCA_S_HEAP_MARKER   0xDDDD
#define _ALLOCA_S_MARKER_SIZE   8
#define _ALLOCA_S_STACK_MARKER   0xCCCC
#define _ALLOCA_S_THRESHOLD   1024
#define _FREEENTRY   0
#define _HEAP_MAXREQ   0xFFFFFFE0
#define _HEAPBADBEGIN   (-3)
#define _HEAPBADNODE   (-4)
#define _HEAPBADPTR   (-6)
#define _HEAPEMPTY   (-1)
#define _HEAPEND   (-5)
#define _HEAPOK   (-2)
#define _INC_MALLOC
#define _malloca (   size)
Value:
__pragma(warning(suppress: 6255 6386)) \
: NULL)
#define _ALLOCA_S_STACK_MARKER
Definition: malloc.h:76
__inline void * _MarkAllocaS(_Out_opt_ __crt_typefix(unsigned int *) void *_Ptr, unsigned int _Marker)
Definition: malloc.h:91
constexpr auto size(const _Container &_Cont) -> decltype(_Cont.size())
Definition: xutility:1477
__inline size_t _MallocaComputeSize(size_t _Size)
Definition: malloc.h:101
#define _ALLOCA_S_HEAP_MARKER
Definition: malloc.h:77
#define _ALLOCA_S_THRESHOLD
Definition: malloc.h:75
#define NULL
Definition: corecrt.h:158
#define _mm_free (   a)    _aligned_free(a)
#define _mm_malloc (   a,
 
)    _aligned_malloc(a, b)
#define _USEDENTRY   1
#define alloca   _alloca

Typedef Documentation

typedef struct _heapinfo _HEAPINFO

Function Documentation

__inline void __CRTDECL _freea ( _Pre_maybenull_ _Post_invalid_ void _Memory)
148  {
149  unsigned int _Marker;
150  if (_Memory)
151  {
152  _Memory = (char*)_Memory - _ALLOCA_S_MARKER_SIZE;
153  _Marker = *(unsigned int*)_Memory;
154  if (_Marker == _ALLOCA_S_HEAP_MARKER)
155  {
156  free(_Memory);
157  }
158  #ifdef _ASSERTE
159  else if (_Marker != _ALLOCA_S_STACK_MARKER)
160  {
161  _ASSERTE(("Corrupted pointer passed to _freea" && 0));
162  }
163  #endif
164  }
165  }
#define _ALLOCA_S_MARKER_SIZE
Definition: malloc.h:82
_ACRTIMP void __cdecl free(_Pre_maybenull_ _Post_invalid_ void *_Block)
#define _ALLOCA_S_STACK_MARKER
Definition: malloc.h:76
#define _ALLOCA_S_HEAP_MARKER
Definition: malloc.h:77
#define _ASSERTE(expr)
Definition: crtdbg.h:707
_ACRTIMP intptr_t __cdecl _get_heap_handle ( void  )
_Check_return_ _DCRTIMP int __cdecl _heapchk ( void  )
_Check_return_ _DCRTIMP int __cdecl _heapmin ( void  )
_ACRTIMP int __cdecl _heapwalk ( _Inout_ _HEAPINFO _EntryInfo)
__inline size_t _MallocaComputeSize ( size_t  _Size)
102  {
103  size_t _MarkedSize = _Size + _ALLOCA_S_MARKER_SIZE;
104  return _MarkedSize > _Size ? _MarkedSize : 0;
105  }
#define _ALLOCA_S_MARKER_SIZE
Definition: malloc.h:82
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
__inline void* _MarkAllocaS ( _Out_opt_ __crt_typefix(unsigned int *) void _Ptr,
unsigned int  _Marker 
)
92  {
93  if (_Ptr)
94  {
95  *((unsigned int*)_Ptr) = _Marker;
96  _Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE;
97  }
98  return _Ptr;
99  }
#define _ALLOCA_S_MARKER_SIZE
Definition: malloc.h:82
_Ret_notnull_ _Post_writable_byte_size_ ( _Size  )
_DCRTIMP int __cdecl _resetstkoflw ( void  )
_STATIC_ASSERT ( sizeof(unsigned int)<=  _ALLOCA_S_MARKER_SIZE)