Use these routines to allocate, free, and reallocate memory.
Memory-Allocation Routines
| Routine | Use | .NET Framework equivalent | 
|---|---|---|
| Allocate memory from stack | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Allocate storage for array, initializing every byte in allocated block to 0 | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Debug version of calloc; only available in the debug versions of the run-time libraries | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Free allocated block | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Free allocated block | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Expand or shrink block of memory without moving it | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Debug version of _expand; only available in the debug versions of the run-time libraries | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Free allocated block | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Debug version of free; only available in the debug versions of the run-time libraries | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Free allocated block from stack | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Get Win32 HANDLE of the CRT heap. | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Return the upper limit for the size of a memory allocation that will be supported by the small-block heap | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Add memory to heap | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Check heap for consistency | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Release unused memory in heap | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Fill free heap entries with specified value | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Return information about each entry in heap | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Allocate block of memory from heap | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Debug version of malloc; only available in the debug versions of the run-time libraries | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Return size of allocated block | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Debug version of _msize; only available in the debug versions of the run-time libraries | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Allocate block of memory from heap | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Allocate block of memory from heap | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Return address of current new handler routine as set by _set_new_handler | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Return integer indicating new handler mode set by _set_new_mode for malloc | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Reallocate block to new size | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Debug version of realloc; only available in the debug versions of the run-time libraries | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Enable error-handling mechanism when new operator fails (to allocate memory) and enable compilation of Standard Template Libraries (STL) | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. | |
| Set new handler mode for malloc | Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples. |