CCRTHeap Class
This class implements IAtlMemMgr using the CRT heap functions.
class CCRTHeap : public IAtlMemMgr
Name | Description |
---|---|
CCRTHeap::Allocate | Call this method to allocate a block of memory. |
CCRTHeap::Free | Call this method to free a block of memory allocated by this memory manager. |
CCRTHeap::GetSize | Call this method to get the allocated size of a memory block allocated by this memory manager. |
CCRTHeap::Reallocate | Call this method to reallocate memory allocated by this memory manager. |
CCRTHeap
implements memory allocation functions using the CRT heap functions, including malloc, free, realloc, and _msize.
See the example for IAtlMemMgr.
IAtlMemMgr
CCRTHeap
Header: atlmem.h
Call this method to allocate a block of memory.
virtual __declspec(allocator) void* Allocate(size_t nBytes) throw();
nBytes
The requested number of bytes in the new memory block.
Returns a pointer to the start of the newly allocated memory block.
Call CCRTHeap::Free or CCRTHeap::Reallocate to free the memory allocated by this method.
Implemented using malloc.
Call this method to free a block of memory allocated by this memory manager.
virtual void Free(void* p) throw();
p
Pointer to memory previously allocated by this memory manager. NULL is a valid value and does nothing.
Implemented using free.
Call this method to get the allocated size of a memory block allocated by this memory manager.
virtual size_t GetSize(void* p) throw();
p
Pointer to memory previously allocated by this memory manager.
Returns the size of the allocated memory block in bytes.
Implemented using _msize.
Call this method to reallocate memory allocated by this memory manager.
virtual __declspec(allocator) void* Reallocate(void* p, size_t nBytes) throw();
p
Pointer to memory previously allocated by this memory manager.
nBytes
The requested number of bytes in the new memory block.
Returns a pointer to the start of the newly allocated memory block.
Call CCRTHeap::Free to free the memory allocated by this method. Implemented using realloc.
Class Overview
CComHeap Class
CWin32Heap Class
CLocalHeap Class
CGlobalHeap Class
IAtlMemMgr Class