Contains memory allocation function prototypes for Maestro libosa.
More...
#include "lib_common.h"
◆ OSA_MEMTYPE_BASE
Value: ((MAX_IO_COMPONENTS + 1) << \
(MEM_TYPE_COMPONENT_SHIFT))
◆ OSA_METADATAMGR_MEMTYPE_BASE
| #define OSA_METADATAMGR_MEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(1 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ OSA_DEVICEMGR_MEMTYPE_BASE
| #define OSA_DEVICEMGR_MEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(2 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ OSA_INPUTMGR_MEMTYPE_BASE
| #define OSA_INPUTMGR_MEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(3 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ OSA_PSMMEMTYPE_BASE
| #define OSA_PSMMEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(4 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ OSA_OSAMEMTYPE_BASE
| #define OSA_OSAMEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(5 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ OSA_AF_MEMTYPE_BASE
| #define OSA_AF_MEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(6 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ OSA_APPS_MEMTYPE_BASE
| #define OSA_APPS_MEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(7 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ OSA_PARSERS_MEMTYPE_BASE
| #define OSA_PARSERS_MEMTYPE_BASE |
Value: (OSA_MEMTYPE_BASE + \
(8 << OSA_MEMTYPE_SEGMENT_SHIFT))
◆ osa_malloc()
| void* osa_malloc |
( |
size_t |
size | ) |
|
- Parameters
-
| size | The number of bytes to allocate |
- Returns
- A pointer to the allocated memory block or NULL on failure
◆ osa_calloc()
| void* osa_calloc |
( |
size_t |
nmemb, |
|
|
size_t |
size |
|
) |
| |
- Parameters
-
| nmemb | The number of elements to allocate |
| size | The size in bytes of each element |
- Returns
- A pointer to the allocated memory block or NULL on failure
◆ osa_realloc()
| void* osa_realloc |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
- Parameters
-
| ptr | The existing memory block |
| size | The size of the new memory block |
- Returns
- A pointer to the allocated memory block or NULL on failure
◆ osa_free()
| void osa_free |
( |
void * |
ptr | ) |
|
- Parameters
-
| ptr | The existing memory block |
◆ osa_memcpy()
| void* osa_memcpy |
( |
void * |
dest, |
|
|
const void * |
src, |
|
|
size_t |
n |
|
) |
| |
Copy from one memory area to another where the areas do not overlap
- Parameters
-
| dest | The destination pointer |
| src | The source pointer |
| n | Number of bytes to copy |
- Returns
- A pointer to dest
◆ osa_memset()
| void* osa_memset |
( |
void * |
src, |
|
|
char |
c, |
|
|
size_t |
n |
|
) |
| |
- Parameters
-
| src | The memory area to fill |
| c | The constant byte to fill with |
| n | Number of bytes to fill |
- Returns
- A pointer to dest
◆ osa_memmove()
| void* osa_memmove |
( |
void * |
dest, |
|
|
const void * |
src, |
|
|
size_t |
n |
|
) |
| |
Copy from one memory area to another. 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.
- Parameters
-
| dest | The destination pointer |
| src | The source pointer |
| n | Number of bytes to copy |
- Returns
- A pointer to dest
◆ osa_set_memtype()
| void osa_set_memtype |
( |
void * |
ptr, |
|
|
uint32_t |
type |
|
) |
| |
Use this API to set the allocating memory block's owner. This API should be called after succeeding to allocate memory.
- Parameters
-
| ptr | The existing memory block |
| type | The module type of this memory block's owner |
- Return values
-
| TRUE | : success |
| FALSE | failure |