CCRTAllocator Class

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

This class provides methods for managing memory using CRT memory routines.

class ATL::CCRTAllocator

Public Methods

NameDescription
CCRTAllocator::Allocate(Static) Call this method to allocate memory.
CCRTAllocator::Free(Static) Call this method to free memory.
CCRTAllocator::Reallocate(Static) Call this method to reallocate memory.

This class is used by CHeapPtr to provide the CRT memory allocation routines. The counterpart class, CComAllocator, provides the same methods using COM routines.

Header: atlcore.h

Call this static function to allocate memory.

static __declspec(allocator) void* Allocate(size_t nBytes) throw();

Parameters

nBytes
The number of bytes to allocate.

Return Value

Returns a void pointer to the allocated space, or NULL if there is insufficient memory available.

Remarks

Allocates memory. See malloc for more details.

Call this static function to free memory.

static void Free(void* p) throw();

Parameters

p
Pointer to the allocated memory.

Remarks

Frees the allocated memory. See free for more details.

Call this static function to reallocate memory.

static __declspec(allocator) void* Reallocate(void* p, size_t nBytes) throw();

Parameters

p
Pointer to the allocated memory.

nBytes
The number of bytes to reallocate.

Return Value

Returns a void pointer to the allocated space, or NULL if there is insufficient memory.

Remarks

Resizes the amount of allocated memory. See realloc for more details.

CHeapPtr Class
CComAllocator Class
Class Overview

Show: