Skip to content

Latest commit

 

History

History
76 lines (73 loc) · 4.08 KB

File metadata and controls

76 lines (73 loc) · 4.08 KB
title Memory Allocation | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-standard-libraries
ms.tgt_pltfrm
ms.topic article
f1_keywords
c.memory
dev_langs
C++
helpviewer_keywords
memory allocation, routines
memory, managing
memory, allocation
ms.assetid b4470556-a128-4782-9943-2ccf7a7d9979
caps.latest.revision 10
author corob-msft
ms.author corob
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

Memory Allocation

Use these routines to allocate, free, and reallocate memory.

Memory-Allocation Routines

Routine Use
_alloca, _malloca Allocate memory from stack
calloc Allocate storage for array, initializing every byte in allocated block to 0
_calloc_dbg Debug version of calloc; only available in the debug versions of the run-time libraries
operator delete Free allocated block
operator delete[] Free allocated block
_expand Expand or shrink block of memory without moving it
_expand_dbg Debug version of _expand; only available in the debug versions of the run-time libraries
free Free allocated block
_free_dbg Debug version of free; only available in the debug versions of the run-time libraries
_freea Free allocated block from stack
_get_heap_handle Get Win32 HANDLE of the CRT heap.
_heapadd Add memory to heap
_heapchk Check heap for consistency
_heapmin Release unused memory in heap
_heapset Fill free heap entries with specified value
_heapwalk Return information about each entry in heap
malloc Allocate block of memory from heap
_malloc_dbg Debug version of malloc; only available in the debug versions of the run-time libraries
_msize Return size of allocated block
_msize_dbg Debug version of _msize; only available in the debug versions of the run-time libraries
new Allocate block of memory from heap
new[] Allocate block of memory from heap
_query_new_handler Return address of current new handler routine as set by _set_new_handler
_query_new_mode Return integer indicating new handler mode set by _set_new_mode for malloc
realloc Reallocate block to new size
_realloc_dbg Debug version of realloc; only available in the debug versions of the run-time libraries
_set_new_handler Enable error-handling mechanism when new operator fails (to allocate memory) and enable compilation of C++ Standard Libraries
_set_new_mode Set new handler mode for malloc

See Also

Run-Time Routines by Category