RTI Connext Traditional C++ API  Version 5.3.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Groups Pages
Heap Support in C

<<extension>> Heap allocation and free routines in C 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 in C

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(), 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)

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 Traditional C++ API Version 5.3.1 Copyright © Mon Feb 19 2018 Real-Time Innovations, Inc