Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otMalloc.h File Reference

memory management library. More...

#include "otdefs.h"

Functions

void _initMalloc ()
 Init malloc functions. This function must be called at setup time as first.
U32 _memFree ()
 Memory free.
void _free (void *ptr)
 Deallocate memory block. A block of memory previously allocated by a call to malloc, calloc or realloc is deallocated, making it available again for further allocations. If ptr does not point to a block of memory allocated with the above functions, it causes undefined behavior. If ptr is a null pointer, the function does nothing. Notice that this function does not change the value of ptr itself, hence it still points to the same (now invalid) location.
void * _malloc (U32 size)
 Allocate memory block. Allocates a block of size bytes of memory, returning a pointer to the beginning of the block. The content of the newly allocated block of memory is not initialized, remaining with indeterminate values. If size is zero, the return value depends on the particular library implementation (it may or may not be a null pointer), but the returned pointer shall not be dereferenced.
void * _calloc (U32 size)
 Allocate and zero-initialize array. Allocates a block of memory for an array of size bytes long, and initializes all its bits to zero.
void * _realloc (void *ptr, U32 size)
 Reallocate memory block. 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.
void * _reallocf (void *ptr, U32 size)


Detailed Description

Version:
1.0.0
Author:
Manuele Turini
footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0