malloc

Allocates memory

#include <stdlib.h>
void *malloc (
        size_t s
)

Arguments

s Number of bytes to allocate

Return Value

A pointer to the allocated memory block is returned. NULL is returned if the allocation failed.

Explanation

A block of s bytes is allocated from the heap.

Notes

At the time of user program activation heap memory is defined as follows:

Bottom address Highest address of module + 4
Top address Highest available memory - 64KB

See Also

calloc(), realloc(), free()