#include <ma.h>
Typedefs | |
typedef void(* | malloc_handler )(int size) |
typedef void *(* | malloc_hook )(int size) |
typedef void(* | free_hook )(void *ptr) |
typedef void *(* | realloc_hook )(void *ptr, int size) |
typedef int(* | block_size_hook )(void *ptr) |
Functions | |
void * | malloc (int size) |
Allocate uninitialized memory. Allocates memory from the mosync heap. | |
void * | calloc (int num_elem, int size_elem) |
Allocate initialized memory. Allocates memory from the mosync heap and sets the contents to null. | |
void | free (void *mem) |
Deallocate memory. Deallocates memory from the mosync heap. | |
void * | realloc (void *old, int size) |
Reallocate memory. Attempts to resize a previously allocated block of memory. If successful, returns a pointer to the resized memory block. The pointer may be identical to the old, or different. Returns NULL on failure, leaving the old memory block untouched. | |
void | default_malloc_handler (int size) __attribute__((noreturn)) |
malloc_handler | set_malloc_handler (malloc_handler) |
malloc_hook | set_malloc_hook (malloc_hook hook) |
free_hook | set_free_hook (free_hook hook) |
realloc_hook | set_realloc_hook (realloc_hook hook) |
block_size_hook | set_block_size_hook (block_size_hook hook) |
void | override_heap_init_crt0 (char *start, int length) |
|
|
|
|
|
|
|
|
|
|
|
Allocate uninitialized memory. Allocates memory from the mosync heap.
|
|
Allocate initialized memory. Allocates memory from the mosync heap and sets the contents to null.
|
|
Deallocate memory. Deallocates memory from the mosync heap.
|
|
Reallocate memory. Attempts to resize a previously allocated block of memory. If successful, returns a pointer to the resized memory block. The pointer may be identical to the old, or different. Returns NULL on failure, leaving the old memory block untouched.
|
|
Calls maPanic(). |
|
Sets the function to be called in case malloc() fails. Setting this to NULL disables the handler system. It is initially set to default_malloc_handler().
|
|
Sets a function to be called instead of the standard malloc(). The malloc_handler system will still work after a hook has been set.
|
|
Sets a function to be called instead of the standard free().
|
|
Sets a function to be called instead of the standard realloc().
|
|
Sets a function to be called from free to get the size of the block.
|
|
This function is not implemented. You may implement it. If you do, it will be called at the beginning of execution, instead of the standard heap initialization function, before C++ static constructors and MAMain. You must call set_malloc_hook() and set_free_hook() from this function, or the heap will be broken and malloc() will not work. You must also call set_realloc_hook(), if your program uses realloc(). This function will only be called on the MAPIP GCC target, because the optional call to this function relies on a special feature of pipe-tool.
|