Skip to content

Latest commit

 

History

History
103 lines (65 loc) · 2.61 KB

ccrtallocator-class.md

File metadata and controls

103 lines (65 loc) · 2.61 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: CCRTAllocator Class
CCRTAllocator Class
11/04/2016
CCRTAllocator
ATLCORE/ATL::CCRTAllocator
ATLCORE/ATL::CCRTAllocator::Allocate
ATLCORE/ATL::CCRTAllocator::Free
ATLCORE/ATL::CCRTAllocator::Reallocate
CCRTAllocator class
3e1b8cb0-859a-41ab-8e93-6f0b5ceca49d

CCRTAllocator Class

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

Syntax

class ATL::CCRTAllocator

Members

Public Methods

Name Description
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.

Remarks

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

Requirements

Header: atlcore.h

CCRTAllocator::Allocate

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.

CCRTAllocator::Free

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.

CCRTAllocator::Reallocate

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.

See also

CHeapPtr Class
CComAllocator Class
Class Overview