Skip to content

Latest commit

 

History

History
45 lines (40 loc) · 3.19 KB

memory-allocation.md

File metadata and controls

45 lines (40 loc) · 3.19 KB
titlems.datedescriptionf1_keywordshelpviewer_keywords
Memory Allocation
11/18/2020
List of Microsoft C runtime functions used to allocate, free, and reallocate memory.
c.memory
memory allocation, routines
memory, managing
memory, allocation

Memory allocation

These routines allocate, free, and reallocate memory.

Memory-allocation routines

RoutineUse
_alloca, _mallocaAllocate memory from the stack
callocAllocate an array and initialize its elements to 0 (zero)
_calloc_dbgDebug version of calloc. Only available in the debug versions of the run-time libraries
operator delete, operator delete[]Free memory allocated on the heap
_expandExpand or shrink a block of memory without moving it
_expand_dbgDebug version of _expand. Only available in the debug versions of the run-time libraries
freeFree memory allocated on the heap
_free_dbgDebug version of free. Only available in the debug versions of the run-time libraries
_freeaFree memory allocated on the stack
_get_heap_handleGet a Win32 HANDLE to the C runtime (CRT) heap.
_heapaddAdd memory to the heap
_heapchkCheck the heap for consistency
_heapminRelease unused memory in the heap
_heapsetFill free heap entries with a value
_heapwalkGet info about each entry in the heap
mallocAllocate memory from the heap
_malloc_dbgDebug version of malloc; only available in the debug versions of the run-time libraries
_msizeReturn the size of an allocated block of memory
_msize_dbgDebug version of _msize; only available in the debug versions of the run-time libraries
new, new[]Allocate a block of memory from the heap
_query_new_handlerGet the address of the current new handler routine set by _set_new_handler
_query_new_modeGet the new handler mode set by _set_new_mode for malloc
reallocReallocate a block to a new size
_realloc_dbgDebug version of realloc; only available in the debug versions of the run-time libraries
_set_new_handlerEnable error-handling mechanism when the new operator fails to allocate memory, and enable compilation of the C++ Standard Libraries
_set_new_modeSet the new handler mode for malloc

See also

Universal C runtime routines by category

close