Memory allocation
These routines allocate, free, and reallocate memory.
Memory-allocation routines
Routine | Use |
---|---|
_alloca , _malloca |
Allocate memory from the stack |
calloc |
Allocate an array and initialize its elements to 0 (zero) |
_calloc_dbg |
Debug version of calloc . Only available in the debug versions of the run-time libraries |
operator delete , operator delete[] |
Free memory allocated on the heap |
_expand |
Expand or shrink a 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 memory allocated on the heap |
_free_dbg |
Debug version of free . Only available in the debug versions of the run-time libraries |
_freea |
Free memory allocated on the stack |
_get_heap_handle |
Get a Win32 HANDLE to the C runtime (CRT) heap. |
_heapadd |
Add memory to the heap |
_heapchk |
Check the heap for consistency |
_heapmin |
Release unused memory in the heap |
_heapset |
Fill free heap entries with a value |
_heapwalk |
Get info about each entry in the heap |
malloc |
Allocate memory from the heap |
_malloc_dbg |
Debug version of malloc ; only available in the debug versions of the run-time libraries |
_msize |
Return the size of an allocated block of memory |
_msize_dbg |
Debug 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_handler |
Get the address of the current new handler routine set by _set_new_handler |
_query_new_mode |
Get the new handler mode set by _set_new_mode for malloc |
realloc |
Reallocate a block to a 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 the new operator fails to allocate memory, and enable compilation of the C++ Standard Libraries |
_set_new_mode |
Set the new handler mode for malloc |
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho