![]() |
m2mb API docs
25.30.003
m2mb API sets documentation
|
Basic functionality of Operating systems debug to build an AppZone app containing these debug traces: More...
Go to the source code of this file.
Functions | |
| void * | m2mb_os_malloc_debug (UINT32 size, const CHAR *place, INT32 line) |
| Allocates bytes of memory (to be used for debug purposes) More... | |
| void * | m2mb_os_calloc_debug (UINT32 size, const CHAR *place, INT32 line) |
| Allocates bytes of memory and init space with 0 (to be used for debug purposes) More... | |
| M2MB_OS_RESULT_E | m2mb_os_free_debug (void *pMem, const CHAR *place, INT32 line) |
| Free allocated memory (to be used for debug purposes) More... | |
| void * | m2mb_os_realloc_debug (void *ptr, UINT32 size, const CHAR *place, INT32 line) |
| Dynamic memory reallocation (to be used for debug purposes) More... | |
Basic functionality of Operating systems debug to build an AppZone app containing these debug traces:
m2m/m2m_generic/common/m2mb_inc/m2mb_os_debug.h
OS debug functions
@notes Dependencies: m2mb_types.h m2mb_os_types.h m2mb_platform_conf.h m2mb_os.h
| void* m2mb_os_calloc_debug | ( | UINT32 | size, |
| const CHAR * | place, | ||
| INT32 | line | ||
| ) |
Allocates bytes of memory and init space with 0 (to be used for debug purposes)
This function provides service to reserve memory space to the caller and initialize it to 0
| [in] | size | size in byte of memory to be allocated and initialize |
| [in] | place | the code it is called from (e.g. FUNCTION or MODULE) |
| [in] | line | the line it is called from (e.g. LINE) |
Example
| M2MB_OS_RESULT_E m2mb_os_free_debug | ( | void * | pMem, |
| const CHAR * | place, | ||
| INT32 | line | ||
| ) |
Free allocated memory (to be used for debug purposes)
This function provides service to free already allocated memory space
| [in] | pMem | pointer to memory where to release previous allocation |
| [in] | place | the code it is called from (e.g. FUNCTION or MODULE) |
| [in] | line | the line it is called from (e.g. LINE) |
Example
| void* m2mb_os_malloc_debug | ( | UINT32 | size, |
| const CHAR * | place, | ||
| INT32 | line | ||
| ) |
Allocates bytes of memory (to be used for debug purposes)
This function provides service to reserve memory space to the caller
| [in] | size | size in byte of memory to be allocated |
| [in] | place | the code it is called from (e.g. FUNCTION or MODULE) |
| [in] | line | the line it is called from (e.g. LINE) |
pointer to 10 UINT32 UINT32 *pUint; pUint = ( UINT32 * )m2mb_os_malloc( 10 * sizeof(UINT32), FUNCTION, LINE ); if ( pUint == NULL ) exit(...)
| void* m2mb_os_realloc_debug | ( | void * | ptr, |
| UINT32 | size, | ||
| const CHAR * | place, | ||
| INT32 | line | ||
| ) |
Dynamic memory reallocation (to be used for debug purposes)
Changes the size of the memory block pointed to by ptr.
The function may move the memory block to a new location (whose address is returned by the function).
The content of the memory block is preserved up to the lesser of the new and old sizes, even if the block is moved to a new location. If the new size is larger, the value of the newly allocated portion is indeterminate.
In case that ptr is a null pointer, the function behaves like malloc, assigning a new block of size bytes and returning a pointer to its beginning.
| [in] |