High Performance OPC UA Server SDK
1.2.0.193
|
Wrapper for common memory operations. More...
Macros | |
#define | ua_memset(s, c, n) ua_p_memset(s, c, n) |
Fill the first n bytes of the memory area pointed to by s with the byte c . More... | |
#define | ua_memmove(dest, src, n) ua_p_memmove(dest, src, n) |
Copy n bytes from memory area src to memory area dest . More... | |
#define | ua_memcpy(dest, src, n) ua_p_memcpy(dest, src, n) |
Copy n bytes from the memory area src to dest . More... | |
#define | ua_memcmp(s1, s2, n) ua_p_memcmp(s1, s2, n) |
Compare the first n bytes of the memory areas s1 and s2. More... | |
Functions | |
void * | ua_malloc (size_t size) |
Allocate memory. More... | |
void * | ua_calloc (size_t nmemb, size_t size) |
Allocate memory for an array of elements. More... | |
void * | ua_realloc (void *ptr, size_t size) |
Change the size of allocated memory. More... | |
void | ua_free (void *ptr) |
Free allocated memory. | |
char * | ua_strdup (const char *s) |
Duplicate a zero terminated string. More... | |
void * | ua_mempcpy (void *dest, const void *src, size_t n) |
Copy n bytes from the memory area src to dest . More... | |
Wrapper for common memory operations.
In case a platform doesn't support standard malloc or has an optimized version of memset it can be forwarded to the custom implementation.
#define ua_memcmp | ( | s1, | |
s2, | |||
n | |||
) | ua_p_memcmp(s1, s2, n) |
Compare the first n
bytes of the memory areas s1 and s2.
#define ua_memcpy | ( | dest, | |
src, | |||
n | |||
) | ua_p_memcpy(dest, src, n) |
Copy n
bytes from the memory area src
to dest
.
The memory areas must not overlap.
dest
. #define ua_memmove | ( | dest, | |
src, | |||
n | |||
) | ua_p_memmove(dest, src, n) |
Copy n
bytes from memory area src
to memory area dest
.
The memory areas may overlap: copying takes place as though the bytes in src
are first copied into a temporary array that does not overlap src
or dest
, and the bytes are then copied from the temporary array to dest
.
#define ua_memset | ( | s, | |
c, | |||
n | |||
) | ua_p_memset(s, c, n) |
Fill the first n
bytes of the memory area pointed to by s
with the byte c
.
s
. void* ua_calloc | ( | size_t | nmemb, |
size_t | size | ||
) |
Allocate memory for an array of elements.
nmemb | Number of elements to allocate. |
size | Size of one element. |
void* ua_malloc | ( | size_t | size | ) |
Allocate memory.
size | Number of bytes to allocate. |
void* ua_mempcpy | ( | void * | dest, |
const void * | src, | ||
size_t | n | ||
) |
Copy n
bytes from the memory area src
to dest
.
The memory areas must not overlap.
dest
. void* ua_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Change the size of allocated memory.
ptr | Pointer to previously allocated memory. |
size | Number of bytes to change memory size to. |