malloc.h¶
-
void *
malloc(msp430_types.h::size_tsize)¶ Allocation a block of memory.
Parameters
size: Size of the block to allocate in bytes. Return values
- The new memory block.
NULLif the “heap” is exhausted.
- The new memory block.
-
void *
realloc(void * ptr,msp430_types.h::size_tsize)¶ Allocated a new block of memory and move the existing content.
This function allocates a new block of memory and memcpy()s the content of the ond
ptrthere.Parameters
ptr: Old memory block that was allocated with malloc.h::malloc(),malloc.h::calloc()ormalloc.h::realloc().size: Size of the new block to allocted in bytes. Return values
- The new memory block.
NULLif the “heap” is exhausted.
- The new memory block.
-
void *
calloc(msp430_types.h::size_tsize,msp430_types.h::size_tcnt)¶ Allocate a memory block and set all its content to zeroes.
Please see
malloc.h::malloc()for more information.Note
This implementation of
malloc.h::calloc()does not catch integer overflowsParameters
size: One factor of the number of bytes to allocated. cnt: The other factor of the number of bytes to allocated. Return values
- The new memory block.
NULLif the “heap” is exhausted.
- The new memory block.
-
void
free(void * ptr)¶ This is a no-op.
You read correctly: This function does noting.
Note
Keep in mind that this function does not free the memory. It does nothing.
Parameters
ptr: The ignored argument.