MakeAllocator Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at MakeAllocator Class.

Supports the WRL infrastructure and is not intended to be used directly from your code.

  
template<  
   typename T,  
   bool hasWeakReferenceSupport =   
         !__is_base_of(RuntimeClassFlags<InhibitWeakReference>,   
   T)> , T)> class MakeAllocator;  
  
template<  
   typename T  
>  
class MakeAllocator<T, false>;  
  
template<  
   typename T  
>  
class MakeAllocator<T, true>;  

Parameters

T
A type name.

hasWeakReferenceSupport
true to allocate memory for an object that supports weak references; false to allocate memory for an object that doesn't support weak references.

Allocates memory for an activatable class, with or without weak reference support.

Override the MakeAllocator class to implement a user-defined memory allocation model.

MakeAllocator is typically used to prevent memory leaks if an object throws during construction.

Public Constructors

NameDescription
MakeAllocator::MakeAllocator ConstructorInitializes a new instance of the MakeAllocator class.
MakeAllocator::~MakeAllocator DestructorDeinitializes the current instance of the MakeAllocator class.

Public Methods

NameDescription
MakeAllocator::Allocate MethodAllocates memory and associates it with the current MakeAllocator object.
MakeAllocator::Detach MethodDisassociates memory allocated by the Allocate method from the current MakeAllocator object.

MakeAllocator

Header: implements.h

Namespace: Microsoft::WRL::Details

Microsoft::WRL::Details Namespace

Show: