Allocates a memory block of the specified size.
Vseg
as required. free() never physically releases memory allocated by malloc. #include <stdlib.h> void *malloc (size_t size); void *_malloc_internal (size_t size);
size
The allocated block may be larger than the specified size, including space required for alignment and maintenance information. The memory is suitably aligned for storage of any type of object.
Always examine the return from malloc, even if the amount of memory requested is small.
_malloc_internal behaves identically to malloc, use it to implement your own debug version of malloc.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/stdlib.h | stdlib.h | clib.lib |
calloc, free, realloc, About heap object management functions, C/C++ Runtime heap, Memory pools