C Porting Layer API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E80003-19
iotcs_port_memory.h File Reference

The file contains porting layer for memory allocation functionality. More...

#include "iotcs_config.h"

Go to the source code of this file.

Functions

void * iotcs_port_malloc (size_t size)
 Allocates size bytes and returns a pointer to the allocated memory The call has the same semantic as libc's malloc call.
void iotcs_port_free (void *ptr)
 Frees a block of memory pointed to by a ptr The memory pointed by a ptr must have been returned by a previous call to a iotcs_port_malloc().

Detailed Description

The file contains porting layer for memory allocation functionality.


Function Documentation

void iotcs_port_free ( void *  ptr)

Frees a block of memory pointed to by a ptr The memory pointed by a ptr must have been returned by a previous call to a iotcs_port_malloc().

If a ptr is NULL, no operation is performed.

Note:
Optional API. Called by the Library if IOTCS_USE_STATIC_HEAP option is NOT defined.
Parameters:
ptra pointer to a memory block allocated previously
void* iotcs_port_malloc ( size_t  size)

Allocates size bytes and returns a pointer to the allocated memory The call has the same semantic as libc's malloc call.

Note:
Optional API. Called by the Library if IOTCS_USE_STATIC_HEAP option is NOT defined.
Parameters:
sizea number of bytes to be allocated. If size is zero, the return value depends on the particular library implementation (it may or may not be a null pointer), but the returned pointer shall not be dereferenced and must be accepted by iotcs_port_free as a valid argument.
Returns:
a pointer to the allocated memory; NULL otherwise