RTI Connext Micro C API Version 4.3.0
Loading...
Searching...
No Matches
OSAPI Memory API

Memory Interface. More...

Functions

void OSAPI_Memory_copy (void *dest, const void *src, RTI_SIZE_T size)
 Copies size bytes from non-overlapping src to dest.
 
void OSAPI_Memory_zero (void *mem, RTI_SIZE_T size)
 Sets memory region to 0.
 
RTI_INT32 OSAPI_Memory_compare (const void *left, const void *right, RTI_SIZE_T size)
 Byte-wise compare of two memory regions.
 
void OSAPI_Memory_move (void *dest, const void *src, RTI_SIZE_T size)
 Moves size bytes from non-overlapping src to dest.
 
void * OSAPI_Memory_fndchr (const void *s, RTI_INT32 c, RTI_SIZE_T n)
 Locate byte in byte string.
 

Detailed Description

Memory Interface.

Function Documentation

◆ OSAPI_Memory_copy()

void OSAPI_Memory_copy ( void * dest,
const void * src,
RTI_SIZE_T size )

Copies size bytes from non-overlapping src to dest.

Valid dest and src >= size, where size >= 0. The src and dst memory regions should NOT overlap or the results will be undetermined. On success move size number of bytes from in [dest, dest+size) are identical to [src, src+size).

Parameters
dest<<out>> Pointer to destination memory region.
src<<in>> Pointer to source memory region.
size<<in>> Number of bytes to copy starting at dest.
Exceptions
None.
MT Safety:
src cannot be modified concurrently and dest cannot be modified or read concurrently.

◆ OSAPI_Memory_zero()

void OSAPI_Memory_zero ( void * mem,
RTI_SIZE_T size )

Sets memory region to 0.

Clear a memory region. Valid memory >= size, where size >= 0. On On success [mem, mem+size) is filled with 0.

Parameters
mem<<out>> Pointer to memory region to be modified.
size<<in>> Number of bytes to fill with zeroes, starting at mem.
Exceptions
None.
MT Safety:
mem cannot be modified or read concurrently.

References RTI_INT32.

◆ OSAPI_Memory_compare()

RTI_INT32 OSAPI_Memory_compare ( const void * left,
const void * right,
RTI_SIZE_T size )

Byte-wise compare of two memory regions.

This function performs a byte-wise comparison of two memory regions of size bytes. left and right must be >= 0 and size >= 0. This function does not alter any memory content.

Parameters
left<<in>> Pointer to logical "left" side of the inequality test.
right<<in>> Pointer to logical "right" side of the inequality test.
size<<in>> Number of bytes to compare, starting from left to right.
Returns
less than, equal to, or greater than 0, according to whether left is lexicographically less than, equal to, or greater than right when taken as unsigned characters.

◆ OSAPI_Memory_move()

void OSAPI_Memory_move ( void * dest,
const void * src,
RTI_SIZE_T size )

Moves size bytes from non-overlapping src to dest.

Copy size bytes from source to dest. Valid dest and source must point to memory regions >= size, where size >= 0. The source and dest memory regions may overlap. On return, size number of bytes from source has been copied to[dest, dest + size) and is identical to [source, source + size].

Parameters
dest<<out>> Pointer to destination memory region.
src<<in>> Pointer to source memory region.
size<<in>> Number of bytes to copy from source to dest.
Exceptions
None.
MT Safety:
source cannot be modified concurrently; dest cannot be modified or read concurrently.

◆ OSAPI_Memory_fndchr()

void * OSAPI_Memory_fndchr ( const void * s,
RTI_INT32 c,
RTI_SIZE_T n )

Locate byte in byte string.

Locate byte in byte string.

Parameters
s<<in>> Pointer to beginning of byte string.
c<<in>> Byte to search for.
n<<in>> Maximum search length.
Returns
pointer to first occurrence of c if found, NULL otherwise.

References RTI_INT32.