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

Go to the source code of this file.

Classes

struct  _heapinfo
 

Macros

#define _INC_MALLOC
 
#define _HEAP_MAXREQ   0xFFFFFFE0
 
#define _STATIC_ASSERT(expr)   typedef char __static_assert_t[ (expr) ]
 
#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 _HEAPINFO_DEFINED
 
#define _mm_free(a)   _aligned_free(a)
 
#define _mm_malloc(a, b)   _aligned_malloc(a, b)
 
#define _CRT_ALLOCATION_DEFINED
 
#define _MAX_WAIT_MALLOC_CRT   60000
 
#define _ALLOCA_S_THRESHOLD   1024
 
#define _ALLOCA_S_STACK_MARKER   0xCCCC
 
#define _ALLOCA_S_HEAP_MARKER   0xDDDD
 
#define _malloca(size)
 
#define _FREEA_INLINE
 
#define alloca   _alloca
 

Typedefs

typedef struct _heapinfo _HEAPINFO
 

Functions

_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_ (_Count *_Size) _CRTIMP _CRT_JIT_INTRINSIC _CRTNOALIAS _CRTRESTRICT void *__cdecl calloc(_In_ _CRT_GUARDOVERFLOW size_t _Count
 
_CRTIMP _CRTNOALIAS void __cdecl free (_Pre_maybenull_ _Post_invalid_ void *_Memory)
 
_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_ (_Size) _CRTIMP _CRT_JIT_INTRINSIC _CRTNOALIAS _CRTRESTRICT void *__cdecl malloc(_In_ _CRT_GUARDOVERFLOW size_t _Size)
 
 _Success_ (return!=0) _Check_return_ _Ret_maybenull_ _Post_writable_byte_size_(_NewSize) _CRTIMP _CRTNOALIAS _CRTRESTRICT void *__cdecl realloc(_Pre_maybenull_ _Post_invalid_ void *_Memory
 
_CRTIMP _CRTNOALIAS void __cdecl _aligned_free (_Pre_maybenull_ _Post_invalid_ void *_Memory)
 
_Check_return_ _CRTIMP size_t __cdecl _aligned_msize (_Pre_notnull_ void *_Memory, _In_ size_t _Alignment, _In_ size_t _Offset)
 
_CRTIMP int __cdecl _resetstkoflw (void)
 
_CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait (_In_ unsigned long _NewValue)
 
_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_ (_NewSize) _CRTIMP void *__cdecl _expand(_Pre_notnull_ void *_Memory
 
_Check_return_ _CRTIMP size_t __cdecl _msize (_Pre_notnull_ void *_Memory)
 
_CRTIMP _CRT_MANAGED_HEAP_DEPRECATE int __cdecl _heapwalk (_Inout_ _HEAPINFO *_EntryInfo)
 
_CRTIMP intptr_t __cdecl _get_heap_handle (void)
 
_Check_return_ _CRTIMP int __cdecl _heapadd (_In_ void *_Memory, _In_ size_t _Size)
 
_Check_return_ _CRTIMP int __cdecl _heapchk (void)
 
_Check_return_ _CRTIMP int __cdecl _heapmin (void)
 
_CRTIMP int __cdecl _heapset (_In_ unsigned int _Fill)
 
_CRTIMP size_t __cdecl _heapused (size_t *_Used, size_t *_Commit)
 
 _STATIC_ASSERT (sizeof(unsigned int)<=_ALLOCA_S_MARKER_SIZE)
 
__inline void_MarkAllocaS (_Out_opt_ __crt_typefix(unsigned int *) void *_Ptr, unsigned int _Marker)
 
__inline int _MallocaIsSizeInRange (size_t size)
 
 __pragma (warning(push)) __pragma(warning(disable
 

Variables

_Check_return_ _Ret_maybenull_ _In_ _CRT_GUARDOVERFLOW size_t _Size
 
_In_ _CRT_GUARDOVERFLOW size_t _NewSize
 
_In_ _CRT_GUARDOVERFLOW size_t _Count
 
_Check_return_ _Ret_maybenull_ _In_ size_t _Alignment
 
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Offset
 

Macro Definition Documentation

#define _ALLOCA_S_HEAP_MARKER   0xDDDD
#define _ALLOCA_S_STACK_MARKER   0xCCCC
#define _ALLOCA_S_THRESHOLD   1024
#define _CRT_ALLOCATION_DEFINED
#define _FREEA_INLINE
#define _FREEENTRY   0
#define _HEAP_MAXREQ   0xFFFFFFE0
#define _HEAPBADBEGIN   (-3)
#define _HEAPBADNODE   (-4)
#define _HEAPBADPTR   (-6)
#define _HEAPEMPTY   (-1)
#define _HEAPEND   (-5)
#define _HEAPINFO_DEFINED
#define _HEAPOK   (-2)
#define _INC_MALLOC
#define _malloca (   size)
Value:
__pragma(warning(suppress: 6255)) \
? (((((size_t)(size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) \
? _MarkAllocaS(_alloca((size_t)(size) + _ALLOCA_S_MARKER_SIZE), _ALLOCA_S_STACK_MARKER) \
: _MarkAllocaS(malloc((size_t)(size) + _ALLOCA_S_MARKER_SIZE), _ALLOCA_S_HEAP_MARKER))) \
: NULL)
#define _ALLOCA_S_STACK_MARKER
Definition: malloc.h:182
__inline void * _MarkAllocaS(_Out_opt_ __crt_typefix(unsigned int *) void *_Ptr, unsigned int _Marker)
Definition: malloc.h:200
_W64 unsigned int size_t
Definition: crtdefs.h:496
#define NULL
Definition: crtdbg.h:30
#define _ALLOCA_S_HEAP_MARKER
Definition: malloc.h:183
__inline int _MallocaIsSizeInRange(size_t size)
Definition: malloc.h:210
__pragma(warning(push)) __pragma(warning(disable
Definition: malloc.h:253
#define _ALLOCA_S_THRESHOLD
Definition: malloc.h:181
#define _MAX_WAIT_MALLOC_CRT   60000
#define _mm_free (   a)    _aligned_free(a)
#define _mm_malloc (   a,
 
)    _aligned_malloc(a, b)
#define _STATIC_ASSERT (   expr)    typedef char __static_assert_t[ (expr) ]
#define _USEDENTRY   1
#define alloca   _alloca

Typedef Documentation

typedef struct _heapinfo _HEAPINFO

Function Documentation

__pragma ( warning(push)  )
254  : 6014))
255 _CRTNOALIAS __inline void __CRTDECL _freea(_Pre_maybenull_ _Post_invalid_ void * _Memory)
256 {
257  unsigned int _Marker;
258  if (_Memory)
259  {
260  _Memory = (char*)_Memory - _ALLOCA_S_MARKER_SIZE;
261  _Marker = *(unsigned int *)_Memory;
262  if (_Marker == _ALLOCA_S_HEAP_MARKER)
263  {
264  free(_Memory);
265  }
266 #if defined (_ASSERTE)
267  else if (_Marker != _ALLOCA_S_STACK_MARKER)
268  {
269  #pragma warning(suppress: 4548) /* expression before comma has no effect */
270  _ASSERTE(("Corrupted pointer passed to _freea", 0));
271  }
272 #endif /* defined (_ASSERTE) */
273  }
274 }
#define _ALLOCA_S_STACK_MARKER
Definition: malloc.h:182
#define _Post_invalid_
Definition: sal.h:701
_CRTIMP _CRTNOALIAS void __cdecl free(_Pre_maybenull_ _Post_invalid_ void *_Memory)
#define _ALLOCA_S_HEAP_MARKER
Definition: malloc.h:183
#define _Pre_maybenull_
Definition: sal.h:687
#define _ASSERTE(expr)
Definition: crtdbg.h:216
#define __CRTDECL
Definition: crtdefs.h:622
#define _CRTNOALIAS
Definition: crtdefs.h:611
_CRTIMP _CRTNOALIAS void __cdecl _aligned_free ( _Pre_maybenull_ _Post_invalid_ void _Memory)
_Check_return_ _CRTIMP size_t __cdecl _aligned_msize ( _Pre_notnull_ void _Memory,
_In_ size_t  _Alignment,
_In_ size_t  _Offset 
)
_CRTIMP intptr_t __cdecl _get_heap_handle ( void  )
_Check_return_ _CRTIMP int __cdecl _heapadd ( _In_ void _Memory,
_In_ size_t  _Size 
)
_Check_return_ _CRTIMP int __cdecl _heapchk ( void  )
_Check_return_ _CRTIMP int __cdecl _heapmin ( void  )
_CRTIMP int __cdecl _heapset ( _In_ unsigned int  _Fill)
_CRTIMP size_t __cdecl _heapused ( size_t _Used,
size_t _Commit 
)
_CRTIMP _CRT_MANAGED_HEAP_DEPRECATE int __cdecl _heapwalk ( _Inout_ _HEAPINFO _EntryInfo)
__inline int _MallocaIsSizeInRange ( size_t  size)
211 {
212  return size + _ALLOCA_S_MARKER_SIZE > size;
213 }
__inline void* _MarkAllocaS ( _Out_opt_ __crt_typefix(unsigned int *) void _Ptr,
unsigned int  _Marker 
)
201 {
202  if (_Ptr)
203  {
204  *((unsigned int*)_Ptr) = _Marker;
205  _Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE;
206  }
207  return _Ptr;
208 }
_Check_return_ _CRTIMP size_t __cdecl _msize ( _Pre_notnull_ void _Memory)
_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_ ( _Count _Size)
_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_ ( _Size  )
new
_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_ ( _NewSize  )
_CRTIMP int __cdecl _resetstkoflw ( void  )
_CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait ( _In_ unsigned long  _NewValue)
_STATIC_ASSERT ( sizeof(unsigned int)<=  _ALLOCA_S_MARKER_SIZE)
_Success_ ( return!  = 0)

Variable Documentation