CComAllocator Class
This class provides methods for managing memory using COM memory routines.
class CComAllocator
Name | Description |
---|---|
CComAllocator::Allocate | Call this static method to allocate memory. |
CComAllocator::Free | Call this static method to free allocated memory. |
CComAllocator::Reallocate | Call this static method to reallocate memory. |
This class is used by CComHeapPtr to provide the COM memory allocation routines. The counterpart class, CCRTAllocator, provides the same methods using CRT routines.
Header: atlbase.h
Call this static function to allocate memory.
static void* Allocate(size_t nBytes) throw();
nBytes
The number of bytes to allocate.
Returns a void pointer to the allocated space, or NULL if there is insufficient memory available.
Allocates memory. See CoTaskMemAlloc for more details.
Call this static function to free allocated memory.
static void Free(void* p) throw();
p
Pointer to the allocated memory.
Frees the allocated memory. See CoTaskMemFree for more details.
Call this static function to reallocate memory.
static void* Reallocate(void* p, size_t nBytes) throw();
p
Pointer to the allocated memory.
nBytes
The number of bytes to reallocate.
Returns a void pointer to the allocated space, or NULL if there is insufficient memory
Resizes the amount of allocated memory. See CoTaskMemRealloc for more details.