 |
 |
Memory Management ..msdn Add comment |
 |
|
CopyMemory
|
|
|
|
 |
 |
 |
|
FillMemory
|
|
The FillMemory function fills a block of memory with a specified value. |
|
 |
 |
 |
|
GetProcessHeap
|
|
The GetProcessHeap function obtains a handle to the heap of the calling process. This handle can then be used in subsequent calls to the HeapAlloc, HeapReAlloc, HeapFree, and HeapSize functions. |
|
 |
 |
 |
|
GetProcessHeaps
|
|
The GetProcessHeaps function obtains handles to all of the heaps that are valid for the calling process. |
|
 |
 |
 |
|
GlobalAlloc
|
|
The GlobalAlloc function allocates the specified number of bytes from the heap |
|
 |
 |
 |
|
GlobalFree
|
|
The GlobalFree function frees the specified global memory object and invalidates its handle |
|
 |
 |
 |
|
GlobalLock
|
|
The GlobalLock function locks a global memory object and returns a pointer to the first byte of the object"s memory block. |
|
 |
 |
 |
|
GlobalMemoryStatus
|
|
The GlobalMemoryStatus function obtains information about the system"s current usage of both physical and virtual memory.
|
|
 |
 |
 |
|
GlobalReAlloc
|
|
Changes the size or attributes of a specified global memory object. The size can increase or decrease. |
|
 |
 |
 |
|
GlobalSize
|
|
The GlobalSize function retrieves the current size, in bytes, of the specified global memory object |
|
 |
 |
 |
|
GlobalUnlock
|
|
Decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE. This function has no effect on memory objects allocated with GMEM_FIXED. |
|
 |
 |
 |
|
HeapAlloc
|
|
The HeapAlloc function allocates a block of memory from a heap. The allocated memory is not movable. |
|
 |
 |
 |
|
HeapCompact
|
|
Attempts to compact a specified heap. It compacts the heap by coalescing adjacent free blocks of memory and decommitting large free blocks of memory. |
|
 |
 |
 |
|
HeapFree
|
|
The HeapFree function frees a memory block allocated from a heap by the HeapAlloc or HeapReAlloc function. |
|
 |
 |
 |
|
HeapLock
|
|
Attempts to acquire the critical section object, or lock, that is associated with a specified heap. |
|
 |
 |
 |
|
HeapReAlloc
|
|
The HeapReAlloc function reallocates a block of memory from a heap. This function enables you to resize a memory block and change other memory block properties. The allocated memory is not movable. |
|
 |
 |
 |
|
HeapSize
|
|
The HeapSize function retrieves the size of a memory block allocated from a heap by the HeapAlloc or HeapReAlloc function. |
|
 |
 |
 |
|
HeapUnlock
|
|
Releases ownership of the critical section object, or lock, that is associated with a specified heap. The HeapUnlock function reverses the action of the HeapLock function. |
|
 |
 |
 |
|
HeapValidate
|
|
Attempts to validate a specified heap. The function scans all the memory blocks in the heap, and verifies that the heap control structures maintained by the heap manager are in a consistent state.
You can also use the HeapValidate function to validate a single memory block within a specified heap, without checking the validity of the entire heap. |
|
 |
 |
 |
|
HeapWalk
|
|
Enumerates the memory blocks in a specified heap created or manipulated by heap memory allocators such as HeapAlloc, HeapReAlloc, and HeapFree. |
|
 |
 |
 |
|
LocalAlloc
|
|
The LocalAlloc function allocates the specified number of bytes from the heap. |
|
 |
 |
 |
|
LocalFree
|
|
The LocalFree function frees the specified local memory object and invalidates its handle. |
|
 |
 |
 |
|
LocalSize
|
|
The LocalSize function returns the current size of the specified local memory object, in bytes. |
|
 |
 |
 |
|
VirtualAllocEx
|
|
Reserves or commits a region of memory within the virtual address space of a specified process. |
|
 |
 |
 |
|
VirtualFreeEx
|
|
Releases, decommits, or releases and decommits a region of memory within the virtual address space of a specified process. |
|
 |
 |
 |
|
ZeroMemory
|
|
Fills a block of memory with zeros. |
|
 |
 |
 |
 |
| Code examples: |
 |
|
|
 |
|
|