RTI Connext C++ API  Version 5.1.0
Heap Support

<<eXtension>> Heap allocation and free routines More...

Functions

void * DDS_Heap_calloc (size_t numElem, size_t size)
 Peforms the logical equivalent of calloc().
 
void * DDS_Heap_malloc (size_t size)
 Peforms the logical equivalent of malloc().
 
void DDS_Heap_free (void *ptr)
 Performs the logical equivalent of free().
 

Detailed Description

<<eXtension>> Heap allocation and free routines

The methods in this class ensure consistent cross-platform implementations for memory allocation (DDS_Heap_malloc() and DDS_Heap_calloc()) and deletion (DDS_Heap_free()).

Applications need to use these routines to reserve memory that the middleware will release or to free memory that the middleware has allocated.

For example, to allocate an optional member in a sample use DDS_Heap_malloc()/ DDS_Heap_calloc(); to release an optional member previously reserved by ::FooTypeSupport::create_data_w_params(), use DDS_Heap_free().

Function Documentation

void* DDS_Heap_calloc ( size_t  numElem,
size_t  size 
)

Peforms the logical equivalent of calloc().

Allocates unused space for an array with numElem elements each of whose size in bytes is size. The memory will be initialized to zeros.

Parameters
numElem<<in>> The number of elements in the array to be allocated
size<<in>> The size in bytes of each element in the array
Returns
If insufficient memory is available, this method will return NULL. Otherwise, upon success it returns a pointer to the allocated space.
void* DDS_Heap_malloc ( size_t  size)

Peforms the logical equivalent of malloc().

Allocates unused space for an object of the specified size. The memory will be initialized to zeros.

Parameters
size<<in>> The size in bytes of the object to be allocated
Returns
If insufficient memory is available, this method will return NULL. Otherwise, upon success it returns a pointer to the allocated space.
void DDS_Heap_free ( void *  ptr)
inline

Performs the logical equivalent of free().

Deallocates the space pointed to by ptr and made available for further allocation.

Parameters
ptr<<in>> A pointer to the space to be deallocated
Returns
None

RTI Connext C++ API Version 5.1.0 Copyright © Mon Feb 3 2014 Real-Time Innovations, Inc