#include <mem.h>
Go to the source code of this file.
Functions | |
void * | calloc (size_t nmemb, size_t size) |
allocate and return pointer to initialized memory | |
void * | malloc (size_t size) |
allocate and return pointer to uninitialized memory | |
void | free (void *ptr) |
return the allocated memory to memory management. | |
long int | random (void) |
generate a random number | |
void | srandom (unsigned int seed) |
seed the random number generator |
This file describes the public programming interface for memory management services and random number services
Definition in file stdlib.h.
|
allocate and return pointer to initialized memory calloc() allocates memory for an array of {nmemb} elements of {size} bytes each and returns a pointer to the allocated memory. The memory is filled with zero values.
Referenced by image_load(). |
|
return the allocated memory to memory management. free() frees the memory space pointed to by {ptr}, which must have been returned by a previous call to malloc(), or calloc(). Other- wise, or if free(ptr) has already been called before, undefined behaviour occurs. If ptr is NULL, no operation is performed.
Referenced by __builtin_delete(). |
|
allocate and return pointer to uninitialized memory malloc() allocates {size} bytes of memory and returns a pointer to it.
Referenced by __builtin_new(), lx_from_images(), and lx_read(). |
|
generate a random number The random() function returns successive pseudo-random numbers
Definition at line 77 of file random.c. References prandom_t::entry, generator, PRANDOM_SLOTS, randstep(), prandom_t::select, and prandom_t::state. |
|
seed the random number generator The srandom() function sets its argument as the seed for a new sequence of pseudo-random integers to be returned by random(). These sequences are repeatable by calling srandom() with the same seed value. If no seed value is provided, the random() function is automatically seeded with a value of 1.
|