SOM Kernel Reference 1-39
SOMCalloc Function
Purpose
Allocates sufficient zeroed memory for an array of objects of a specified size.
Syntax
somToken (*SOMCalloc) (size_t num, size_t size);
Description
The SOMCalloc function allocates an amount of memory equal to num*size (sufficient
memory for an array of num objects of size size). The SOMCalloc function has the same
interface as the C calloc function. It performs the same basic function as calloc with some
supplemental error checking. If an error occurs, the SOMError function is called. This
routine is replaceable by changing the value of the global variable SOMCalloc.
Parameters
num The number of objects for which space is to be allocated.
size The size of the objects for which space to is to be allocated.
Return Value
A pointer to the first byte of the allocated space.
Example
See the somVprintf function.
Related Information
Functions: SOMMalloc, SOMRealloc, SOMFree
Data Structures: somToken (somapi.h)
Komentarze do niniejszej Instrukcji