XMP Toolkit SDK  6.0.0
AdobeXMPCommon::IMemoryAllocator_v1 Class Referenceabstract

Version1 of the interface that represents an interface to be implemented by client in case he is interested in controlling the memory allocation and deallocation on the heap. More...

#include <IMemoryAllocator.h>

Public Member Functions

virtual void *APICALL allocate (sizet size) __NOTHROW__=0
 Called by the library whenever it needs some space on the heap. More...
 
virtual void APICALL deallocate (void *ptr) __NOTHROW__=0
 Called by the library whenever there is no further need for a previously allocated space on the heap. More...
 
virtual void *APICALL reallocate (void *ptr, sizet size) __NOTHROW__=0
 Called by the library whenever it needs to expand or contract some space already allocated on the heap, preserving the contents. More...
 
virtual ~IMemoryAllocator_v1 ()
 

Protected Member Functions

 REQ_FRIEND_CLASS_DECLARATION ()
 

Detailed Description

Version1 of the interface that represents an interface to be implemented by client in case he is interested in controlling the memory allocation and deallocation on the heap.

In case client is interested in controlling the memory allocation and deallocation on the heap he can implement this interface and register the same with the #AdobeXMPCommon::IConfigurationManager. For every request of memory allocation or deallocation on the heap corresponding function will be called by the library.

Attention
Support for Multi threading is under clients hand.

Definition at line 29 of file IMemoryAllocator.h.

Constructor & Destructor Documentation

◆ ~IMemoryAllocator_v1()

virtual AdobeXMPCommon::IMemoryAllocator_v1::~IMemoryAllocator_v1 ( )
inlinevirtual

Definition at line 56 of file IMemoryAllocator.h.

56 {}

Member Function Documentation

◆ allocate()

virtual void* APICALL AdobeXMPCommon::IMemoryAllocator_v1::allocate ( sizet  size)
pure virtual

Called by the library whenever it needs some space on the heap.

Parameters
[in]sizeA value of type #AdobeXMPCommon::sizet indicating the number of bytes required by the library on the heap.
Returns
A pointer to memory location on the heap.

◆ deallocate()

virtual void APICALL AdobeXMPCommon::IMemoryAllocator_v1::deallocate ( void *  ptr)
pure virtual

Called by the library whenever there is no further need for a previously allocated space on the heap.

Parameters
[in]ptrA pointer to a memory location which is no longer needed.

◆ reallocate()

virtual void* APICALL AdobeXMPCommon::IMemoryAllocator_v1::reallocate ( void *  ptr,
sizet  size 
)
pure virtual

Called by the library whenever it needs to expand or contract some space already allocated on the heap, preserving the contents.

Parameters
[in]ptrA pointer to a memory location which was previously allocated on the heap.
[in]sizeA value of type #AdobeXMPCommon::sizet indicating the new number of bytes required by the library on the heap.
Returns
A pointer to memory location on the heap which is of new size and previous contents are preserved.

◆ REQ_FRIEND_CLASS_DECLARATION()

AdobeXMPCommon::IMemoryAllocator_v1::REQ_FRIEND_CLASS_DECLARATION ( )
protected

The documentation for this class was generated from the following file: