StuBS
|
C-style dynamic memory allocation interface. More...
#include "types.h"
Functions | |
void * | malloc (size_t size) |
Allocate a memory block The memory is not initialized. | |
void | free (void *ptr) |
Free an allocated memory block. | |
void * | calloc (size_t nmemb, size_t size) |
Allocate memory for an array of elements The memory is set to zero. | |
C-style dynamic memory allocation interface.
void * calloc | ( | size_t | nmemb, |
size_t | size ) |
Allocate memory for an array of elements The memory is set to zero.
nmemb | Number of elements |
size | Size of an element in bytes |
nullptr
if the request fails void free | ( | void * | ptr | ) |
Free an allocated memory block.
ptr | Pointer to an previously allocated memory block. |
void * malloc | ( | size_t | size | ) |
Allocate a memory block The memory is not initialized.
size | Requested size of memory in bytes. |
nullptr
on error (no memory available) or if size was zero.